JSON Key Sorter
Sort the keys of a JSON object alphabetically, including keys inside nested objects if you want. Paste your JSON and copy the sorted result.
1 Paste your text and pick the options
2 Your answer
Your answer shows here as you type.
How to use the JSON Key Sorter
- Paste your JSON object into the box.
- Choose A to Z or Z to A for the key order.
- Turn off nested sorting to sort only the top-level keys.
- Copy the sorted JSON from the result.
Frequently asked questions
How do I sort JSON keys alphabetically?
Parse the JSON object, sort its keys by comparing the key strings, and write the object back out in that order. The values stay the same; only the order of the keys in the text changes.
Does sorting JSON keys change the data?
The values and meaning stay the same, because JSON parsers treat objects as unordered maps. The text does change, so a checksum or signature made over the original text will no longer match.
How are uppercase and lowercase keys ordered?
Sorting compares character codes, so uppercase letters come before lowercase ones: "B" sorts before "a". Keys that are whole numbers are always listed first in numeric order by JavaScript engines.
Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.