JSON Sort
- Natural order
- Sort arrays
- Nothing uploaded
Recursive key sorting with natural ordering, plus sorting arrays by any field.
Paste input on the left to see sorted.
Everything runs in your browser — nothing is uploaded.
About sort keys
Sorting JSON makes two exports of the same data comparable. JSONic sorts object keys recursively using natural ordering, so item2 comes before item10, optionally ignoring case or reversing direction. It can also sort arrays of objects by any field that every element shares.
Sorting is how you make two exports of the same data comparable. This goes further than an alphabetical key sort: natural ordering puts item2 before item10 rather than after it, case-insensitive mode stops uppercase keys clustering at the top, and arrays of objects can be ordered by any field they all share. The result is a document that diffs cleanly against another export of the same data.
Questions
How is this different from the formatter's Sort keys checkbox?
The formatter does a plain alphabetical key sort. This tool adds natural ordering, case-insensitive comparison, reverse order, and sorting arrays of objects by a chosen field — none of which a single checkbox can express.
What is natural ordering?
Lexicographic sorting puts item10 before item2, because it compares character by character. Natural ordering compares embedded numbers numerically, giving item2 then item10 — which is almost always what you meant.
Does sorting arrays change my data?
Array order is significant in JSON, so yes, that is a real change. Key sorting is not, since objects are unordered. Arrays are only reordered when you name a field, and only when every element actually has it.