format · validate · convert · runs locally

JSON Sort Keys

Recursively sort every object’s keys alphabetically and pretty-print the result — so two JSON documents with the same data but different key order become directly comparable. Array order is preserved. Copy it or download the .json. Runs in your browser.

Frequently asked questions

Does sorting keys change my data?

No — only the order of object keys changes. Values, array order, and the parsed data are identical; JSON object key order is not semantically significant.

Why sort JSON keys?

Canonical key order makes diffs stable, git history cleaner, and two equivalent documents byte-comparable after formatting.