JSON Sorter — Sort JSON Keys A–Z Online
- This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.
Input
Tab indents · Shift+Tab outdents · Esc then Tab moves on
Your formatted JSON shows up here
Paste or type on the left, upload a file, or drop one onto the input.
JSON & data
About this tool
Two JSON documents can hold exactly the same data and still look completely different if their keys come in a different order. That makes diffs noisy and code reviews harder. The JSON sorter opens with Sort keys switched on, so pasting your JSON gives you a version where every object has its keys in alphabetical order, at every level of nesting.
Only objects are sorted. Arrays keep their order, because the position of items in an array is part of the data. Keys are compared with locale-aware ordering, so accented letters and mixed case sort the way people expect. Duplicate keys are kept and flagged rather than dropped.
Sorting is purely cosmetic and does not rewrite your data: numbers and strings are written back exactly as typed, so 1.0, 1E3 and 20-digit integers are preserved. A common workflow is to sort both versions of a file and then compare them in the JSON diff tool, or to commit config files in sorted form so changes show only real differences.
You can still choose the indentation, minify the result, or switch to the tree view. Everything runs in your browser.
Frequently asked questions
Does sorting change the meaning of my JSON?
No. JSON objects are unordered collections of keys, so sorting changes only how the text looks. Arrays are never reordered because their order matters.
Are nested objects sorted too?
Yes. Every object at every level is sorted, including objects inside arrays.
How are keys compared?
Alphabetically using locale-aware comparison, so it behaves like sorting words in a dictionary rather than by raw character code.
Why sort before comparing two files?
If both files list keys in the same order, a diff shows only real changes in values or structure, not reordering noise.
Can I sort values or array items?
This tool sorts keys only. Array order is part of the data, so it is left alone.
Is my JSON uploaded anywhere?
No. Everything runs in your browser and nothing is sent to a server, so API responses, tokens and customer records stay on your device. A share link carries the JSON in the part of the address after the #, which browsers never send to a server, but anyone who has the link can read it.