JSON Sort Keys
Sort the keys of a JSON object alphabetically, A to Z or Z to A, including nested objects, with optional array sorting. Makes JSON easy to diff. Free tool.
Runs in your browser. Nothing is uploaded.
About JSON Sort Keys
JSON Sort Keys reorders every object's keys alphabetically, all the way down the tree if you want. Two files with the same data but different key order then line up perfectly in a diff.
It's also handy for tidying package.json dependencies, translation files and config files so keys are easy to find. Array order is kept unless you choose to sort arrays too.
How to use JSON Sort Keys
- Type or paste your text into the input box. Press Sample to see an example.
- Adjust the options. The result updates as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
Does key order matter in JSON?
Not to the data. Objects are unordered, so sorting is safe for parsers, though humans and diffs benefit from it.
Why are arrays not sorted by default?
Array order is meaningful in JSON, so it's only changed when you ask.
Is JSON Sort Keys free and private?
Yes. JSON Sort Keys is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.