Sort JSON
Sort the keys of a JSON object alphabetically, recursively and consistently.
Related tools
Sort JSON
Paste any JSON and this tool re-emits it with every object's keys in alphabetical order, all the way down. Nested objects are sorted recursively, so two files that differ only in key order become identical byte for byte — which is exactly what you want before diffing config files, comparing API responses or committing generated JSON that would otherwise churn on every save.
The key order is case-insensitive with a deterministic tiebreak, so "Name" and "name" sit together and the same input always produces the same output. Choose A to Z or Z to A, and pick the indentation that fits your workflow: two spaces, four spaces, a tab, or fully minified on one line. Numbers, booleans, null and string values keep their original form — sorting only rearranges object keys, it never rewrites your data.
By default arrays are left exactly as they are, because the order of items in an array usually carries meaning. Turn on "Sort primitive arrays" and arrays made purely of numbers are sorted numerically and arrays made purely of strings are sorted alphabetically. Arrays that mix types, or that contain objects, are deliberately left untouched so their meaning is never silently changed. If the same key appears twice in an object, JSON keeps the last value, following the standard parser.
The live tally shows how many keys were sorted, how deep the structure nests and the size of the output. Everything runs entirely in your browser, so even private payloads and secrets stay on your machine — nothing is ever uploaded.