Online Sort JSON Keys

Sort JSON object keys alphabetically, including nested objects, then output it neatly indented. Useful for normalization and stable diffs. Everything runs in your browser.

The result will appear here…
or press Ctrl+Enter

Everything runs in your browser.

728 × 90Ad Space AvailablePlace your ad here

Example

Example Input

{"b":2,"a":1}

Example Output

{
  "a": 1,
  "b": 2
}

How to Use

  1. 1Paste JSON into the Input field.
  2. 2Click Run.
  3. 3Copy the key-sorted JSON.

About Sort JSON Keys

This tool parses your JSON, sorts each object's keys alphabetically and recursively, then outputs it with 2-space indentation. Array element order is preserved.

Sorting keys makes two equivalent JSON documents look identical, produces stable diffs across versions, and makes large configs easier to read.

FAQ

Is my data sent to a server?

No. Everything is processed in your browser.

Related Tools

Related Categories