JSON Sorter
Sort the keys of a JSON object alphabetically, recursively, in your browser.
Suggested tools
About JSON Sorter
JSON Sorter orders the keys of every object alphabetically, at every level of nesting, and formats the result neatly. Sorted JSON is much easier to compare, review in pull requests and keep consistent across config files and translation files.
Arrays keep their original order — only object keys are sorted — so the meaning of your data never changes. Numbers are kept exactly as written. Everything runs locally in your browser — the text you paste is never uploaded.
How to use JSON Sorter
- Paste your JSON or upload a .json file.
- Press Convert to sort the keys.
- Copy or download the sorted JSON.
Key features
- Sorts keys recursively, at every depth
- Array order preserved
- Validates first, with line and column on errors
- Exact number formatting kept
Example
Keys are sorted at every level; the array keeps its order.
{"zeta":1,"alpha":{"b":2,"a":1},"list":[3,1,2]}{
"alpha": {
"a": 1,
"b": 2
},
"list": [
3,
1,
2
],
"zeta": 1
}When to use JSON Sorter
- Making two JSON files comparable before using JSON Compare or a Git diff.
- Keeping translation and config files in a predictable order.
- Reducing merge conflicts in files edited by several people.
Tips and common problems
- Sorting is case-sensitive: uppercase keys come before lowercase ones.
- Array order is never changed, because it can carry meaning.
- Sort both files the same way before comparing them.
Frequently asked questions
When two files have the same keys in a different order, diffs show changes that are not real. Sorting both first makes JSON Compare and Git diffs show only genuine differences.
Yes. Keys are compared by character code, so uppercase letters come before lowercase (B before a).
No — arrays keep their order. Sorting array items by a field would change the meaning of the data.