JSON Tools
JSON Sort Keys
Recursively sort all object keys alphabetically.
JSON input
Indent:
Sorted output
Output appears hereAbout this tool
Make JSON canonical and diff-friendly by alphabetising every object's keys, top-level and nested. Arrays keep their order. Useful for snapshot tests, config-file diffs, and deterministic hashes.
FAQs
Are array elements sorted too?
No - arrays are ordered data, so element order is kept. Only object keys are sorted.
What about case?
Standard string comparison - uppercase letters sort before lowercase (A-Z then a-z) by default.
Will it preserve all values exactly?
Yes - only key order changes. Values, types, and nesting are untouched.