About this tool
Recursively sorts every object's keys alphabetically, at every nesting depth. Array order is left untouched — only object key order changes. Useful for producing consistent, diff-friendly JSON before committing it to version control.
Recursively sort JSON object keys alphabetically for cleaner, diff-friendly output. Runs entirely in your browser.
Recursively sorts every object's keys alphabetically, at every nesting depth. Array order is left untouched — only object key order changes. Useful for producing consistent, diff-friendly JSON before committing it to version control.
Copy this HTML to cite this tool from your own site or article.
JSON Key Sorter sorts JSON object keys alphabetically at all nesting levels to produce clean, canonical, diff-friendly JSON documents.
Input: {"z":1, "a":2} Sorted Output: { "a": 2, "z": 1 }
No. Array element order is preserved exactly as defined; only object keys are sorted.
Yes. Object keys at every level of nesting are sorted alphabetically.
Text & Data
Compare two JSON documents and inspect changed paths locally.
Text & Data
Rename JSON object keys everywhere they appear, at any nesting depth.
Text & Data
Escape text for embedding in JSON, or unescape a JSON string literal back to raw text.