Jotai vs Zustand
Both made by the same people. Both are better than Redux. The difference is atoms vs stores.
Zustand
Zustand is simpler to understand and works for 90% of state management needs. Jotai is more powerful for fine-grained reactivity but the mental model is harder to grok. Start with Zustand, reach for Jotai when you need it.
Same Creator, Different Philosophy
Dai Shi (pmndrs) created both. Zustand is a top-down store. Jotai is bottom-up atoms. They solve the same problem differently.
Zustand: Create a store with state and actions. Subscribe to slices. Simple.
Jotai: Create atoms (individual pieces of state). Compose them. Derive computed values. More granular, more React-like.
Why Zustand is Easier
A Zustand store is just an object. create((set) => ({ count: 0, increment: () => set(s => ({ count: s.count + 1 })) })). Done.
No providers, no context, no wrappers. Use it anywhere. The API is 5 functions. You can learn it in 10 minutes.
It works outside React too. Use it in vanilla JS, in a worker, wherever.
When Jotai Shines
Jotai prevents unnecessary re-renders at a granular level. If component A uses atom X and component B uses atom Y, updating X never re-renders B. With Zustand, you need selectors to achieve this.
Async atoms are elegant. atom(async (get) => fetch(get(urlAtom))) — derived async state in one line.
For forms, complex UI state, or apps with many independent pieces of state, Jotai's atom model scales better.
Quick Comparison
| Factor | Jotai | Zustand |
|---|---|---|
| Mental Model | Atoms (bottom-up) | Store (top-down) |
| Learning Curve | Medium | Easy |
| Re-render Control | Automatic, granular | Selectors needed |
| Async State | Built-in (async atoms) | Manual |
| DevTools | Good | Good |
| Bundle Size | ~3KB | ~1KB |
| Outside React | React-focused | Works anywhere |
The Verdict
Use Jotai if: You have lots of independent state atoms, need fine-grained re-render control, or love the atom/derived value pattern.
Use Zustand if: You want the simplest possible state management, need to use state outside React, or just want something that works without thinking.
Consider: If you're using TanStack Query for server state, you might not need either. Client state is often smaller than you think.
Zustand is simpler to understand and works for 90% of state management needs. Jotai is more powerful for fine-grained reactivity but the mental model is harder to grok. Start with Zustand, reach for Jotai when you need it.
Related Comparisons
Disagree? nice@nicepick.dev