All tools
Developer utility

JSON Key Sorter

Sort strict JSON object keys predictably while preserving numeric tokens. Processing stays in your browser and no draft is saved.

Sort strict JSON object keys locally in your browser. Nothing is uploaded or saved; refreshing clears your draft. Arrays stay in their original order and number tokens such as 1e+2 stay exact.

JSON input

0 bytes of 2 MiB maximum. Strict JSON only.

Sorting and output

How to sort JSON keys

  1. Paste strict JSON or choose a UTF-8 JSON file.
  2. Choose whether to sort nested objects, then sort the document. Arrays keep their original item order.
  3. Review the selectable output, then copy it or download sorted.json.

Worked example

The object {"z":1,"a":{"y":2,"b":3}} becomes {"a":{"b":3,"y":2},"z":1} when recursive sorting is selected. Only object-property order changes.

Rules and limits

Keys are compared as exact Unicode strings. Strict JSON rejects comments, trailing commas and duplicate keys. Values, arrays and numeric source tokens are preserved; this is not a schema validator, formatter for JSON5 or a way to change object semantics. Refreshing clears local input.