JSON Unflattener
Rebuild nested JSON from flat dot-notation or bracket-notation keys.
Sort JSON object keys alphabetically at every level, or sort arrays by a field.
The JSON Sorter orders object keys alphabetically at every nesting level, using a natural comparison so item2 comes before item10. Arrays of objects can also be sorted by any field you name.
Two JSON documents that hold the same data can look completely different if the keys come back in a different order. Sorting them both makes the pair comparable by eye, by a text diff and by a checksum — which is the usual reason to do it.
Keys are sorted at every level, with a natural comparison so item2 comes before item10 rather than after it. Arrays of objects can be sorted separately by any field you name, ascending or descending, which is how you make a list of records line up between two environments. Sorting never changes a value: only the order keys appear in, which JSON itself treats as insignificant.
Nested objects are sorted too, not just the top one, so the whole document reaches a canonical order.
Digit runs are compared as numbers, so item2 sorts before item10 rather than after it.
Name a field such as id or name to order arrays of records, ascending or descending.
Only the order keys appear in changes, which JSON itself treats as insignificant. The data is byte-for-byte the same.
Sort two responses the same way and a plain text diff will show only the real differences.
Any document — the sorter walks every level of it.
A to Z or Z to A for object keys, applied at every depth.
Name a field such as id or name to order arrays of objects by it as well.
Take the sorted document to your clipboard or download it.
The specification says an object is unordered, so no parser should depend on it. It matters to humans and to tools that compare text, which is exactly why sorting is useful.
Not unless you ask. Array order is usually meaningful, so items keep their positions unless you name a field to sort them by.
One that reads digit runs as numbers, so item2 sorts before item10. A plain string sort would put item10 first, which is rarely what anyone wants.
Yes, and it is one of the best uses for it. Sort both, then run them through the JSON Diff or any text diff and only real differences will show.
What people who use the JSON Sorter think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON Sorter. It takes half a minute and no account.
Write the first reviewRebuild nested JSON from flat dot-notation or bracket-notation keys.
Compile SCSS to plain CSS in your browser — nesting, variables and mixins.
Convert between px, rem, em, pt, %, vw and vh with the right context.
Turn a CSV export into INSERT statements, with column types inferred.
Generate Kotlin data classes with Gson or kotlinx.serialization annotations.
Reveal tabs, non-breaking spaces and zero-width characters in your text.
Build a frosted glass panel with backdrop blur, over a real background.
Fix broken JSON: trailing commas, single quotes, unquoted keys and comments.