🔒 Runs in your browser — nothing is uploaded✓ Free, no signup
JSON Sorter — Sort Keys Alphabetically
Sort the keys of a JSON object alphabetically — including every nested object — to make JSON easier to read, compare and keep tidy.
0 characters
Sorted JSON
When should you use the JSON Sorter?
- Making two JSON files easier to compare by putting keys in the same order
- Tidying config files and translation (i18n) files
- Producing stable, predictable JSON for diffs and code review
How to use the JSON Sorter
- 1
Paste JSON
Paste an object or array into the left editor.
- 2
Choose the order
A → Z or Z → A. Natural order puts item2 before item10.
- 3
Pick what to sort
Nested objects are sorted by default. Tick 'Also sort arrays of values' to sort lists of strings or numbers too.
- 4
Copy or download
Copy the sorted JSON or download it.
Examples
Nested keys sorted A → Z
Before
{ "zebra": 1, "apple": { "z": true, "b": 2 } }After
{
"apple": {
"b": 2,
"z": true
},
"zebra": 1
}Common errors and how to fix them
Numeric keys come first- JavaScript always puts integer-like keys such as "1" and "2" before other keys, in numeric order. This is how JSON objects work in browsers.
Array items didn't move- Arrays are kept in order by default because order often matters. Tick 'Also sort arrays of values' to sort them.
More from JSON Tools
Free tools that run in your browser — no signup, nothing uploaded.
JSON Auto-Fixer & Formatter
Repair, validate, and beautify broken JSON (missing quotes, trailing commas).
JSON Validator & Linter
Check JSON syntax and see the exact line and column of every error.
JSON Viewer (Tree)
Explore JSON as a collapsible tree with search and click-to-copy paths.
JSON Editor
Edit JSON with live validation, a tree view, formatting and key sorting.
JSON Beautifier
Pretty-print and indent JSON for easy reading and debugging.
JSON Compare & Diff Tool
Find the difference between two JSON objects visually and quickly.
JSONPath Tester
Evaluate JSONPath expressions with filters and recursive queries.
JSON Schema Generator
Generate a JSON Schema from any sample JSON document.
JSON to CSV Converter
Flatten nested JSON arrays into CSV for spreadsheets.
JSON Sorter FAQ
No. Only the order of keys changes — values stay the same, and JSON objects are unordered by definition, so the data is equivalent.
Yes, by default every object at every level is sorted. Untick 'Sort nested objects' to sort only the top level.
It compares numbers inside keys by value, so item2 comes before item10. Plain alphabetical order would put item10 first.
Sorted keys make files easier to scan and make diffs cleaner, because the same keys always appear in the same place.
Not yet — it sorts keys and, optionally, arrays of plain strings or numbers.
No. Everything runs in your browser, so your JSON never leaves your device.
