Paste JSON
Add any JSON document — an object, an array, or a nested structure.
Sort every object key in a JSON document alphabetically. Sorting is recursive through nested objects, with optional sorting inside object arrays.
Any valid JSON document. Object keys are reordered alphabetically; values are unchanged.
Three simple steps, with your content kept on your device.
Add any JSON document — an object, an array, or a nested structure.
Every object key is reordered alphabetically, recursively through the whole tree.
Grab the sorted JSON or save it as a .json file.
Fast, focused, and made to be clear on every screen.
Nested objects are sorted at every depth, not just the top level.
Keep array element order or sort the keys of object elements too.
Sorting happens in your browser. Your JSON never leaves your device.
A json key sorter online reorders the keys of every object in a JSON document alphabetically. The values and their nesting never change — only the order in which keys appear.
Sorted keys make files easier to scan, diffs cleaner, and committed JSON deterministic. When a team stores configuration or generated data as JSON, a stable key order means pull requests show real changes instead of noise from key shuffling.
To sort JSON alphabetically, paste your document into the editor and run the sorter. Every object key is reordered in alphabetical order, recursively through the whole tree — nested objects are sorted at every depth, not just the top level.
For array elements that are objects, you choose the behavior: keep the array order as written, or sort the keys of each object element too. The result can be copied or downloaded as a .json file.
Only key order changes. Values keep their exact types — strings, numbers, booleans, null, arrays, and objects — and nesting structure is untouched. A number stays a number and is not re-quoted or reformatted.
The sorter validates the input first. If the document is not valid JSON, you get a clear error instead of partial or corrupted output, so you can fix the source and sort again.
JSON alphabetical order is most valuable for configuration files, API response fixtures, and schema examples that humans inspect regularly. Predictable ordering turns a wall of keys into something you can read top to bottom.
It also helps when comparing two versions of a document: once both sides are sorted the same way, the diff highlights real differences rather than reordering artifacts.
JSON documents often contain credentials, personal data, or internal configuration. Sorting runs entirely in your browser, so your JSON never leaves your device — no upload, no account, no server round trip.
The sorter works offline once the page is loaded and processes even large documents instantly, with a clear input limit to protect your browser's memory.
Sorting is one step in a larger JSON workflow. The JSON Formatter makes any document readable, and the JSON Validator checks syntax before you sort or commit.
When you need to compare payloads, the JSON Diff Checker highlights exactly what changed between two versions, and the JSON Schema Validator checks a document against a schema before it reaches production.
Paste {"zeta": 1, "alpha": {"mango": 2, "banana": 3}} and the sorter returns {"alpha": {"banana": 3, "mango": 2}, "zeta": 1} — keys at every level are arranged alphabetically while values keep their exact form.
The comparison is case-sensitive and follows Unicode code point order, which matches how most tooling and text editors sort. Digits sort before letters, and uppercase letters sort before lowercase ones, so results are predictable and consistent across runs.
Run the sorter on the same document repeatedly and the output is always identical. That determinism is exactly what makes sorted keys useful in version control: once a file is normalized, future changes are the only thing that appears in the diff.
The sorter accepts documents of any nesting depth up to the input limit, so deeply nested API responses and configuration trees sort just as reliably as flat objects. Whatever your document looks like, the key order comes out the same every time.
Whether you are tidying a one-off payload or normalizing a committed config file, a few seconds of sorting keeps JSON readable and diffs meaningful for everyone who works with the file afterward.
No. Only the order of object keys changes. Values, types, and nesting are preserved exactly.
Sorted keys make diffs cleaner, config files easier to scan, and generated output deterministic for teams that commit JSON files.
By default array element order is preserved. Enable 'Sort their keys too' to also sort the keys of object elements inside arrays.