JSON

JSON Sorter

Sort every object key alphabetically — produce stable, canonical JSON for diffs and reviews.

Sorting happens locally in your browser. Nothing is uploaded, logged, or stored.

0 chars
1
Paste JSON here, e.g. {"zebra": 1, "apple": 2}...
0 chars
Result appears here

How to use

  1. Paste your JSON into the input panel.
  2. Optionally enable Reverse order or Sort arrays of primitives.
  3. Click Sort — keys at every nesting level are reordered alphabetically.
  4. Copy or download the sorted result.

Why sort JSON keys?

JSON objects are unordered by specification, but in practice key order changes between tools, languages, and versions. That makes text diffs noisy: two semantically identical documents look different just because keys moved. Sorting keys recursively produces a canonical form — feed both versions through this tool and your diff shows only real data changes.

The sorter walks the whole tree: nested objects are sorted too, and arrays of strings/numbers can be sorted on demand. Pair it with the JSON Diff tool for noise-free comparisons, or the JSON Formatter if your input fails to parse.

Examples

Noise-free diffs

Sort two API snapshots before diffing them so key reordering stops drowning out the real changes.

Stable hashes

Canonical JSON gives you a repeatable string to hash when you need a content fingerprint of a payload.

Frequently Asked Questions

Is my data uploaded anywhere?+
No. Sorting runs entirely in your browser with built-in JavaScript. The page keeps working offline once loaded.
Does sorting change the meaning of my JSON?+
No for objects — JSON object key order has no semantic meaning. Arrays are only reordered if you explicitly enable Sort arrays of primitives, since array order usually matters.
Are nested objects sorted too?+
Yes. Every object at any depth is sorted, so the output is fully canonical.
What happens with invalid JSON?+
The parser error is shown above the output. Clean up the syntax with the JSON Formatter & Validator first.

Related Tools

Looking for something else? Browse all tools