Zustand vs Jotai
Zustand vs Jotai compared for 2026: Zustand 5.1 (a single hook-based store with selectors and middleware) vs Jotai 3.0 (atomic state that builds a dependency graph). Includes re-render counts for each pattern, update cost with many subscribers, server-side rendering leaks between requests, bundle sizes, the Jotai v3 breaking changes and when to pick each.
Quick Answer
Zustand and Jotai are both small React state libraries from the Poimandres (pmndrs) GitHub organisation and share a core maintainer, and both avoid the provider boilerplate of React context. They model state differently. Zustand 5.1.0 (6 November 2026) gives you one store per create() call, read through selector hooks; components re-render when their selected slice changes, and every store update runs every subscribed selector. Jotai 3.0.2 (9 November 2026) gives you atoms, small units of state that can derive from each other; components subscribe to atoms, and an update only reaches atoms that depend on it. In our React 19.3.1 runs on 30 November 2026 both rendered only the component whose field changed when used idiomatically. Zustand was cheaper per update (200,000 updates in 18-25 ms against 228-315 ms) until many components subscribed: with 1,000 subscribers the same updates took 1,514-1,563 ms against 267-308 ms for Jotai. Zustand's smallest store bundled to 443 bytes gzipped, Jotai's atoms with hooks to 3.2 kB. On the server, Jotai's provider-less default store leaked one request's user into the next request's HTML; a Zustand module store kept the value in memory but rendered its initial state. Jotai v3 is ESM-only, needs Node.js 22.12+ and React 18+, and moved atomFamily out to jotai-family.
Last updated November 30, 2026. Covers Zustand 5.1.0 (6 November 2026) and Jotai 3.0.2 (9 November 2026) with React 19.3.1; npm registry metadata, release notes, READMEs, the Jotai v3 migration guide and both projects' comparison, SSR and Next.js docs read on 30 November 2026, plus re-render, update-cost, SSR, bundle and v3 packaging runs we did that day.
| Feature | Zustand | Jotai |
|---|---|---|
| Licence & Repository | MIT; pmndrs/zustand, ~59.1k stars | MIT; pmndrs/jotai, ~21.4k stars |
| Latest Release (Nov 2026) | 5.1.0 on 6 Nov 2026 | 3.0.2 on 9 Nov 2026 (3.0.0 on 8 Sep 2026) |
| State Model | Single store per create(); selectors pick slices | Atoms in a store; dependency graph of derived atoms |
| Dependencies & Install | 0 deps; 1 package, 300 KB on disk | 0 deps; 1 package, 360 KB on disk |
| Requirements | Node.js >= 12.20; React >= 18 optional peer; ESM and CJS builds | Node.js >= 22.12; React >= 18; TypeScript >= 5.5; ESM only |
| Our Run: Minimal Bundle (min / gzip) | 694 B / 443 B (create + selector hook) | 7,395 B / 3,246 B (atom + derived atom + hooks) |
| Our Run: With Persistence Utilities (min / gzip) | 10,967 B / 4,700 B (persist + devtools + useShallow) | 9,878 B / 4,228 B (+ atomWithStorage, selectAtom, unwrap, Provider) |
| Provider Needed | No (module store); createStore + context for SSR | Optional; default store without one, Provider for scoped stores |
| What Re-renders a Component | Selector result changes (Object.is) | Read atom's value changes |
| Reading a Whole Object | useStore() with no selector re-renders on every change | One object atom re-renders every reader; derive field atoms |
| Selectors Returning New Objects | New object each render → infinite loop error; use useShallow | Not applicable; derived atoms compare their results |
| Derived / Computed State | Compute in selectors or store actions | Derived atoms with automatic dependency tracking |
| Async State | Async actions call set() when done; no Suspense integration | Async atoms suspend via React use(); unwrap and Raw hooks to avoid it |
| Persistence | persist middleware (sync or PromiseLike storage) | atomWithStorage in jotai/utils |
| DevTools | devtools middleware (Redux DevTools), actionCreators in 5.1.0 | Separate jotai-devtools package |
| Our Run: SSR State Between Requests | Module store kept 'alice' in memory, rendered initial state; per-request store isolated | Default store leaked 'alice' into request 2; Provider per request isolated |
| Use Outside React | getState / setState / subscribe; zustand/vanilla | createStore() / getDefaultStore() get, set, sub; jotai/vanilla |
| Our Run: 200k Updates, No Subscribers | 18-25 ms | 228-315 ms |
| Our Run: 200k Updates, 1,000 Subscribers | 1,514-1,563 ms (every listener runs) | 267-308 ms (only dependents notified) |
| Release Activity (2026) | 5.0.10 to 5.0.16 and 5.1.0 (Jan-Nov 2026) | 2.18.1 to 2.20.3, then 3.0.0 to 3.0.2 (Mar-Nov 2026) |
Zustand
Zustand is a small state library built around one idea: create() returns a hook bound to a store, and components call that hook with a selector to read the slice they need. The store is a plain object holding state and actions; set() merges updates, get() reads the current state inside actions, and the same store is usable outside React through getState(), setState() and subscribe(), or from zustand/vanilla without React at all. Re-rendering is controlled by the selector: a component re-renders when its selector's result changes by Object.is, and useShallow from zustand/shallow handles selectors that return objects or arrays. Middleware covers persistence (persist, which since 5.1.0 accepts PromiseLike storage and returns a Promise from rehydrate()), Redux DevTools (devtools, with an actionCreators option in 5.1.0), Immer, subscribeWithSelector and combine. Zustand has no dependencies; React, Immer and use-sync-external-store are optional peers. Stores are module-level by default, so server rendering frameworks need a per-request store passed through context, as the Zustand docs describe.
Pros
- Tiny core: our minimal store and hook bundled to 694 bytes minified, 443 gzipped (React external)
- Cheapest raw updates: 200,000 setState calls with no subscribers took 18-25 ms against 228-315 ms for Jotai's store.set
- One place for state and actions, readable outside React with getState() and setState(), and no provider needed in client apps
- Per-field selectors re-rendered only the component whose field changed (101 vs 1 render over 100 updates)
- Mature middleware: persist with async storage and awaitable rehydrate (5.1.0), devtools with action dispatching, immer
- Stable 5.x API with regular patch releases; 59.1k GitHub stars and 2 open issues
Cons
- Every update runs every subscribed selector: with 1,000 subscribers, 200,000 unrelated updates took 1,514-1,563 ms against 267-308 ms for Jotai
- A selector that returns a new object crashed our component with 'Maximum update depth exceeded' until wrapped in useShallow
- Calling the hook without a selector re-rendered every reader on every change (101 renders each)
- Module-level stores persist across server requests; for SSR you must create a store per request and pass it through context
- No built-in derived or async state model; computed values live in selectors and loading flags in your store
Best For
Apps with a few well-defined global stores (session, cart, UI settings), teams coming from Redux who want actions next to state, and code that must read or write state outside React components.
Jotai
Jotai is an atomic state library for React. You declare atoms, atom(0) for a primitive value or atom((get) => get(a) * 2) for a derived one, and read them with useAtom, useAtomValue or useSetAtom. Atoms hold no value themselves; a store does, either the implicit default store or one you create with createStore() and pass to a Provider. Because derived atoms record which atoms they read, Jotai keeps a dependency graph and only recomputes and notifies what depends on a changed atom. Async atoms return promises and suspend components through React's use() on React 19, with useAtomValueRaw and useAtomValueRawSync added in v3 for cases that should not suspend. jotai/utils adds atomWithStorage, selectAtom, unwrap, atomWithReducer and more. Jotai 3.0.0 (8 September 2026) modernized the package: ESM only, Node.js 22.12 or later, React 18 or later, TypeScript 5.5 or later, only public entry points exported, and atomFamily, loadable, useReducerAtom, freezeAtomCreator, jotai/babel, setSelf and the delay option removed or moved to separate packages such as jotai-family.
Pros
- Updates only reach dependents: with 1,000 subscribed atoms, 200,000 unrelated updates took 267-308 ms against 1,514-1,563 ms for Zustand
- Derived atoms compose: field atoms derived from one object atom re-rendered only the affected component (101 vs 1)
- No selector memoization traps: separate atoms re-render precisely without equality functions
- Async atoms integrate with Suspense through React's use(), with non-suspending hooks added in v3
- Per-request isolation is one <Provider> or createStore() per request, which rendered each request's own user in our SSR test
- Zero dependencies; 21.4k stars, 1 open issue, active v3 line
Cons
- Its provider-less default store is shared across server requests: our second, anonymous request rendered the first request's user
- Higher fixed cost per update: 200,000 store.set calls with no subscribers took 228-315 ms against 18-25 ms for Zustand
- Larger floor: atoms plus hooks bundled to 3,246 B gzipped against 443 B for a Zustand store
- v3 breaking changes: ESM only, Node.js 22.12+, React 18+, TypeScript 5.5+; atomFamily and loadable are gone from jotai/utils
- State spread across many atoms is harder to see as a whole and to act on outside React than one store object
Best For
UIs with many independent or derived pieces of state (editors, dashboards, forms, canvases), apps that lean on Suspense for async data, and teams who think in useState-like units rather than one central store.
One store versus many atoms: the model decides the trade-offs
Both libraries come from Poimandres and share a maintainer, and the Zustand docs put the difference in one line: Zustand is a single store, while Jotai consists of primitive atoms that can be composed together. In Zustand you write const useCart = create((set) => ({ items: [], add: (i) => set((s) => ({ items: [...s.items, i] })) })) and read with useCart((s) => s.items.length). State and the functions that change it live together, the store exists as a module-level object, and you can call useCart.getState().add(x) from a WebSocket handler or a test without rendering anything. In Jotai you write const itemsAtom = atom([]) and const countAtom = atom((get) => get(itemsAtom).length), and components use useAtomValue(countAtom). Values live in a store that is either implicit or provided, and each derived atom records which atoms it read, so Jotai knows that changing itemsAtom affects countAtom and nothing else. The consequences follow from that. Zustand asks you to write selectors carefully, because the selector decides what re-renders. Jotai asks you to split state into atoms carefully, because the atom boundaries decide what re-renders. Zustand updates are a function call and a list of listeners; Jotai updates walk a graph. Zustand reads naturally outside React; Jotai needs a store reference. The Jotai docs describe their approach as bottom-up and inspired by Recoil, and that framing is a good test: if your state looks like a few documents, Zustand fits; if it looks like a spreadsheet, Jotai does.
Re-renders: what we counted in React 19
We mounted two components in jsdom 31.0.1 with React 19.3.1, one reading field a and one reading field b, then changed a 100 times inside act(). Used idiomatically, both libraries were precise. Zustand with per-field selectors, useStore((s) => s.a) and useStore((s) => s.b), rendered A 101 times (mount plus 100 updates) and B once. Jotai with two primitive atoms did the same: 101 and 1. The traps are mirror images. Zustand without a selector, const { a } = useStore(), re-rendered both components 101 times, because the whole state object changes on every set. A selector returning a fresh object, useStore((s) => ({ a: s.a })), did worse: React threw 'Maximum update depth exceeded' on mount, exactly the infinite loop the Zustand v5 migration guide warns about, and wrapping it in useShallow brought counts back to 101 and 1. In Jotai, putting both fields in one object atom re-rendered both readers 101 times, the same mistake as Zustand's missing selector. Deriving field atoms from that object, atom((get) => get(objAtom).b), restored 101 and 1, because a derived atom only notifies when its own result changes. In practice that means Zustand rules are about selectors (always pass one, useShallow for objects) and Jotai rules are about granularity (one atom per independently changing value, or derived atoms over a larger one). Both are easy to follow and easy to forget, so a render-count test like ours in CI catches regressions for either.
What we measured: update cost, many subscribers and bundle size
We timed both stores without React first, on one pinned core, three runs. 200,000 updates with no subscribers: Zustand's setState took 18-25 ms, Jotai's store.set 228-315 ms, because Jotai maintains its graph on every write. Then we added 1,000 subscribers, each watching its own value, Zustand through subscribe() with a selector-style comparison (what a component's useStore does) and Jotai through store.sub() on 1,000 separate atoms, and made 200,000 updates to an unrelated field. Zustand rose to 1,514-1,563 ms because every update calls every listener and each one re-runs its selector. Jotai stayed at 267-308 ms because none of those atoms depended on the changed one. Inside React the difference mostly disappeared behind rendering work: with 1,000 mounted components and 200 updates to one item, Zustand took 258-321 ms and Jotai 211-281 ms; with 10,000 components Zustand took 1,172-1,337 ms and Jotai 1,364-1,561 ms, with 200 renders each time and heap at 82-85 MB against 92-95 MB. So the store model matters most when updates are frequent and subscribers numerous, such as live data or pointer-driven editors. Bundles, built with esbuild 0.25.12, minified, React external, production mode: a Zustand store with an action and a selector hook was 694 bytes, 443 gzipped; with persist, devtools and useShallow 10,967 and 4,700. Jotai atoms, a derived atom and the three hooks were 7,395 and 3,246; adding atomWithStorage, selectAtom, unwrap and Provider made 9,878 and 4,228. Each installs as one package with no dependencies.
Server rendering: the per-request store problem
Both libraries default to state that outlives a request, and both sets of docs say so. Zustand's Next.js guide calls the store a global variable, module state, and says it should be created per request and not shared. Jotai's guide says the implicit global store is kept alive and shared between requests, which can lead to bugs and security risks. We simulated two server requests with renderToString: the first writes the signed-in user 'alice' into state and renders, the second is anonymous. With Jotai's default store, the anonymous request rendered user=alice, a real cross-user leak. With a createStore() passed to a Provider for each request, the requests rendered bob and none, correctly isolated. Zustand behaved differently than we expected. After setState({ user: 'alice' }) on a module store, the server render still showed none, because Zustand's hook reads getInitialState() for the server snapshot. The HTML did not leak, but getState() during the anonymous request still returned alice, so any code reading the store directly, in a loader, an API route or an action, would see another user's data. The documented pattern, createStore() per request passed through React context and read with useStore(store, selector), rendered bob and none. The rule for both: in Next.js, Remix, TanStack Start or any SSR setup, never write request data into module-level state. With Jotai, put a Provider at the root of every request tree; with Zustand, create the store inside a component or request handler and provide it through context. Client-only single-page apps can use the module defaults safely.
Versions, migration and when not to use each
Zustand is on a stable 5.x line: seven 5.0.x patches between January and October 2026 and 5.1.0 on 6 November, which made persist accept PromiseLike storage and return an awaitable Promise from rehydrate(), and let Redux DevTools dispatch store actions through an actionCreators option. It still ships CommonJS, supports Node.js 12.20 and up, and treats React as an optional peer. Jotai shipped its 2.x line through 2.20.3 and released 3.0.0 on 8 September 2026, followed by 3.0.1 to fix a useAtomValue regression and 3.0.2 on 9 November. The migration guide calls v3 mostly backward-compatible: if your app runs on v2 without deprecation warnings, the core hooks behave the same. The packaging changes are what bite. Jotai 3 is ESM only, though on Node.js 22.23.5 require('jotai') still worked through Node's require(esm). It needs Node.js 22.12 or later, React 18 and TypeScript 5.5, and deep imports fail: importing jotai/esm/vanilla.mjs threw ERR_PACKAGE_PATH_NOT_EXPORTED. In our install atomFamily and loadable were undefined in jotai/utils; the first moved to jotai-family 1.1.0, the second is replaced by unwrap. Do not choose Zustand for state made of hundreds of independently updated values with many subscribers, or where derived async data and Suspense are central. Do not choose Jotai for a couple of global stores that non-React code reads and writes, for projects stuck on Node.js 20 or CommonJS-only test tooling, or for teams that find a graph of atoms harder to reason about than one object. Both can coexist; a common split is Zustand for app-wide session data and Jotai for one complex feature.
Verdict
Pick Zustand for most apps whose shared state fits in a handful of stores: a session, a cart, feature flags, UI preferences. It was the smallest and cheapest per update in our runs (443 bytes gzipped, 200,000 updates in 18-25 ms), keeps state and actions in one object you can read outside React, and its rules are few: always pass a selector, and wrap selectors that return objects or arrays in useShallow. Pick Jotai when state is many small, interdependent pieces: editors, design tools, dashboards with dozens of widgets, forms with derived validation, or anything that leans on Suspense for async data. Its dependency graph means an update only touches what depends on it, which in our test kept 200,000 updates at 267-308 ms with 1,000 subscribers where Zustand's every-listener model took 1,514-1,563 ms. Whichever you pick, do not use module-level state in server rendering: create a Zustand store per request and pass it through context, or wrap each Jotai request in its own Provider; our test showed Jotai's default store rendering one user's data for another. If you are on Node.js 20 or need CommonJS-only tooling, stay on Jotai 2.x until you can upgrade, or choose Zustand.