What this JSON sorter does
Two JSON documents can contain identical data and still look completely different, because object keys can appear in any order. That’s harmless to parsers and miserable for humans: diffs light up with moved lines, code review noise buries real changes, and comparing two API responses by eye becomes guesswork. This sorter normalizes a document by ordering every object’s keys alphabetically — at every nesting level — while leaving array order, values and structure untouched.
Combined with consistent indentation (choose 2 spaces, 4 spaces or tabs), sorted JSON gives you a canonical form: the same data always serializes to the same text.
How to sort JSON keys
- Paste your JSON into the input box.
- Choose A→Z or Z→A and an indentation style.
- Click Sort keys and copy the normalized result.
Where sorted JSON pays off
Sort before committing configuration files so future diffs show only real edits; sort two API responses before comparing them; sort translation files so every locale lists keys in the same order and missing entries stand out. For an automated comparison after normalizing, feed both documents to the JSON Diff tool — sorted input makes its output cleaner too.