JSON Sorter
Paste JSON on the left and every object's keys are sorted alphabetically — recursively, at every nesting level. Toggle ascending or descending, pick your indentation, copy the result. All in your browser.
How to use this tool
Paste or type your JSON into the input on the left.
Pick Ascending (A→Z) or Descending (Z→A). The output updates live.
Choose 2 or 4 space indentation, or minified output.
Copy the sorted result with one click.
Sorting is recursive: nested objects and objects inside arrays are sorted too. Array element order is preserved.
Frequently asked questions
Does it sort arrays as well as objects?
No — array element order is preserved by design, because array order usually carries meaning (priority, chronology). Only object keys are sorted. If you need array sorting, use the jq tool with a sort_by filter.
Is the sorting recursive?
Yes. Keys are sorted at every nesting level: nested objects, objects inside arrays, and deeply nested structures are all handled.
Why sort JSON keys?
Sorted keys make diffs between two documents meaningful, stabilize output for snapshot tests, and make large configs easier to scan by eye.
What sort algorithm is used for ordering?
Keys are compared lexicographically (Unicode code point order), the same ordering JSON.stringify and most diff tools use, so results are deterministic across runs.
Is my data uploaded anywhere?
No. Sorting happens entirely in your browser with JavaScript. No network request carries your JSON — you can verify in DevTools.