JSON Key Sort (Unified key order for easier diffs)
Automatically align JSON key order to speed up reviews and comparisons. Choose all levels or top-level only.
- Easier diffs with fixed key order
- Array order is preserved by default
- Indent and sort in one step
Інструмент
Налаштування
Array element order is preserved.
詳細設定
Як користуватися
1. Paste
Paste JSON into the input panel.
2. Choose scope & indent
Pick all levels or top level only, and set the indent.
3. Sort & copy
Click “Sort & format” and copy the output.
Example
{"b":1,"a":{"d":4,"c":3},"arr":[{"y":2,"x":1},3]}
{
"a": {
"c": 3,
"d": 4
},
"arr": [
{
"x": 1,
"y": 2
},
3
],
"b": 1
}
{
"a": {
"d": 4,
"c": 3
},
"arr": [
{
"y": 2,
"x": 1
},
3
],
"b": 1
}
What you can do
Sort keys for the entire JSON or only the top level
Keep array element order while sorting object keys
Switch between ascending/descending order
Choose indent or minify in one click
Specifications (arrays / nesting / numbers)
- Object keys are sorted lexicographically (code point order).
- Arrays keep their element order.
- Indent can be 2, 4, tab, or minify.
- If the input is not valid JSON, the output is not updated.
- This tool supports standard JSON only (no comments or trailing commas).
- Large inputs may take a moment to process in the browser.
Поширені запитання
Are nested objects sorted?
Yes. Choose “All levels” or “Top level only”.
What about arrays?
Array element order is preserved. Objects inside arrays follow the chosen sort scope.
Can I keep the original indentation?
The output uses the indent you select (2/4/tab/minify), not the original formatting.
Can I use JSON with comments (JSON5)?
No. This tool supports standard JSON only.
Where is the processing done?
All processing runs in your browser; nothing is sent to a server.