Sort JSON Keys
Sort every object’s keys alphabetically, at every level of nesting, so two versions of a document line up cleanly in a diff.
Paste, drop or type your JSON
It’s checked as you type — nothing is uploaded.
Ctrl + V to paste · drop a .json file anywhere here
Ctrl Enter ValidateCtrl Shift F FormatCtrl Shift M MinifyCtrl Z Undo
How to use it
- Paste your JSON or upload a .json file.
- Click “Sort keys”. Every object, however deeply nested, is reordered A–Z.
- Copy or download the result. Ctrl + Z restores the original order.
Arrays keep their order
Only object keys are sorted. Array items stay where they are, because their position usually carries meaning.
Stable diffs
Serializers often write keys in a different order each time. Sorting both versions first makes a text diff show only real changes — or use JSON Diff, which ignores key order entirely.
Duplicate keys
If an object contains the same key twice, you’re warned before sorting, because only the last value can be kept.
More validate & format tools
All free, all private, all running locally in your browser.