← All Tools
Json Sort🔒 100% local
Sort JSON keys alphabetically. Privacy-first, no server uploads, no tracking.
Recursively sorts object keys into ascending order and reprints the document with two-space indentation. Every object at every depth is sorted, including objects nested inside arrays; array order itself is never touched. Key order is the only thing that changes, and the sorting runs inside the browser tab.
How to use it
- Paste a JSON document.
- Click Process to reorder the keys.
- Copy the reordered document from the output box.
Worked example
{"z":1,"a":{"y":2,"x":3}}becomes{
"a": {
"x": 3,
"y": 2
},
"z": 1
}The nested object is sorted in place inside its parent's alphabetical slot.
When to use it
- Normalising a hand-edited config file so a diff shows real changes instead of keys moving around.
- Producing a stable serialisation before hashing or signing a payload, where key order would otherwise change the bytes.
- Making a large JSON fixture easier to scan for a missing field.
What it does not do
- Ordering is JavaScript string comparison, not locale-aware: uppercase letters sort before lowercase ones, so "Zebra" comes before "apple", and digits sort before letters.
- Because JSON objects are unordered by definition, sorting changes the text but not the data - if something downstream depends on insertion order, do not sort.
- It never reorders arrays, so sorting an array of records by one of their fields is not something this tool does.