Skip to main content
>_devtools

JSON Sort Keys

Sort JSON object keys alphabetically at every level, ascending or descending, with array order preserved.

What this does

Paste a JSON value to sort object keys alphabetically at every level. Choose ascending or descending order, comparison rules, depth, and indentation.

Example

Input:
{"z":1,"a":{"y":2,"b":3}}

Sorted output:
{
  "a": {
    "b": 3,
    "y": 2
  },
  "z": 1
}

Limits and behavior

  • Object keys are sorted; array item order is preserved.
  • Only valid JSON can be sorted.