Example: before and after
Input
{"b":1,"a":{"d":4,"c":3},"arr":[{"y":2,"x":1},3]}
Standardize JSON key order automatically to make reviews and comparisons easier.
Choose every level or the top level only. Array order stays intact.
Sort and format JSON in one step, then copy or download the result.
Shortcut: press Ctrl / Cmd + Enter to run
Input
{"b":1,"a":{"d":4,"c":3},"arr":[{"y":2,"x":1},3]}
Sort every level (2 spaces)
{
"a": {
"c": 3,
"d": 4
},
"arr": [
{
"x": 1,
"y": 2
},
3
],
"b": 1
}
Sort the top level only
Top-level keys become a, arr, b, while the key order inside "a" stays as entered.
Yes. Choose every level to sort nested objects, or choose top level only to leave nested key order unchanged.
Array element order is preserved. Objects inside arrays are sorted when they fall within your selected scope.
The original whitespace is not preserved. Output is reformatted with the indentation style you select.
No. This tool accepts standard JSON only; JSON5 comments and trailing commas are not supported.
Everything runs locally in your browser. Your input is never sent to a server.