JSON Sort Keys
Recursively sort JSON object keys alphabetically. Optionally also sort arrays of primitives, or arrays of objects by a chosen key. Useful before committing config to git, before generating a hash, or before piping to a strict-order downstream tool.
Paste JSON.
How to sort JSON keys
- Paste your JSON.
- Toggle options:
- Recursive (default on) — sort keys in every nested object.
- Sort arrays of primitives — on / off.
- Sort arrays of objects by key — pick a key name (e.g.
id) to sort by. - Direction — A → Z or Z → A.
- Output appears live. Copy or Download.
FAQ
Does sorting change the meaning of the JSON?
No — JSON object key order is not semantically significant per RFC 8259. But many tools (including some YAML / TOML round-trippers) preserve order, so sort intentionally.
Will it sort numerically or lexicographically?
Lexicographically — "10" sorts before "2". JSON keys are always strings.
Will it work offline?
Yes.