JSON Sort Keys
Sort JSON object keys A→Z or Z→A, with optional deep recursive sort.
Why Sort JSON Keys?
Sorting JSON keys alphabetically makes large objects easier to scan by eye, produces stable diffs in version control, and can simplify comparisons between JSON documents with the same fields in different orders.
Deep sort applies the same ordering recursively to every nested object, so the entire document is consistently alphabetised regardless of nesting depth.
Sort Options
A → Z
Sorts keys in ascending alphabetical order using locale-aware comparison.
Z → A
Sorts keys in descending alphabetical order — useful for reverse-priority configs.
Deep Sort
When checked, sorts keys at every nesting level. When unchecked, only the top-level keys are sorted.
FAQ
Is my data sent to a server?
No. Sorting runs entirely in your browser using JavaScript. Your JSON data never leaves your device.
Does sorting change array order?
No. Arrays are not reordered — only object keys are sorted. Array elements stay in their original positions.
Is key sorting preserved when I parse JSON?
JavaScript objects do not guarantee key order, but modern engines (V8, SpiderMonkey) preserve insertion order for string keys. JSON.stringify outputs keys in insertion order, so the sorted output will reflect the sorted order.
Does this handle deeply nested JSON?
Yes. With "Deep sort" checked, the sort recurses into every nested object at any depth.