JSON Key Sorter

Sort JSON object keys alphabetically.

Developer

Paste JSON to sort object keys alphabetically. Optionally sort recursively in nested objects. Output is formatted (beautified). Useful for consistent diffs and documentation. Runs in your browser.

About JSON Key Sorter

JSON object keys have no defined order, but sorting them alphabetically makes diffs and snapshots consistent. This tool parses your JSON, sorts keys (optionally in every nested object), and outputs formatted JSON. Handy for documentation and testing.

How to use

  1. Paste JSON into the input. Check Sort keys recursively if you want nested objects sorted too.
  2. Click Sort keys. The result is shown below. Copy if needed.

Frequently Asked Questions

What does recursive sort mean?
When enabled, keys are sorted in nested objects too. When disabled, only the top-level keys are sorted.
Is my JSON sent to a server?
No. Parsing and sorting run entirely in your browser.
What if my JSON is invalid?
The tool will show an error with the parser message. Fix the JSON (e.g. trailing commas, unquoted keys) and try again.