JSON Sorter
runs in your browserno sign-upfree
Sort JSON object keys A→Z or Z→A, including nested objects, and optionally sort arrays.
Keys sorted A → Z, including nested objects
About this tool
This JSON sorter reorders the keys of every object alphabetically, A to Z or Z to A, including nested objects. Sorted keys make two JSON files easy to compare and keep config files tidy. Arrays keep their order unless you choose to sort arrays of plain text or numbers too.
How to use
- Paste your JSON into the JSON box.
- Choose A → Z or Z → A and the indent you want.
- Optionally tick "Also sort arrays" to sort lists of strings or numbers.
- Copy the sorted JSON or download it.
FAQ
Are arrays sorted too?
Not by default, because the order of items in an array usually matters. With the option ticked, arrays that contain only strings or only numbers are sorted; arrays of objects keep their order (the keys inside each object are still sorted).
How are keys like "item2" and "item10" ordered?
Naturally, the way people expect: item2 comes before item10. Upper and lower case are treated the same.
Why sort JSON keys?
Two JSON documents with the same data can list keys in a different order. Sorting both first makes a diff show only the real differences — try it together with the Text Diff Checker.
Is my JSON uploaded anywhere?
No. Everything runs in your browser, so API responses, config files and other data never leave your device. Your last input is saved only in this browser; press Clear to remove it.