JSON Sorter
Sort JSON object keys alphabetically at every level, leaving arrays alone.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the json sorter
- Paste your JSON.
- Choose ascending or descending.
- Copy the sorted result.
About this tool
Object keys are sorted at every level; array order is left untouched. That distinction is the whole point. Key order in a JSON object carries no meaning — the standard says objects are unordered — but array order is data, and reordering it would change what the document says.
The practical reason to sort is comparison. Two documents holding identical data can produce a wall of diff noise purely because their keys came out in different orders. Sort both and the real differences are all that is left.
It also makes large configuration files navigable, since you can predict where a key will be rather than searching for it.
Everything happens in the page. JSON commonly carries API keys, personal records and internal identifiers, so nothing here is uploaded, logged or sent to a server — which is exactly why a browser tool is the right place to inspect it.
Common uses
- Making two documents comparable before diffing them.
- Tidying a configuration file so keys are easy to find.
- Producing stable output for version control.
Frequently asked questions
- Does sorting change my data?
- No. Object key order carries no meaning in JSON, so sorting keys leaves the data identical. Array order is preserved because that order is meaningful.
- Why are arrays not sorted?
- Because their order is data. Sorting an array of steps or a ranked list would change what the document says.
- Does it sort nested objects?
- Yes, at every level, including objects inside arrays.
Related tools
JSON Formatter
Format, validate and minify JSON with clear error messages that point at the exact position.
JSON Diff
Compare two JSON documents structurally, ignoring key order and formatting.
JSON Viewer
Explore JSON as a collapsible tree, with node counts, depth and located errors.
JSON Key Extractor
List every key path in a JSON document with its type and how often it appears.