General dev

JSON Key Sorter

Runs locally

Use JSON Key Sorter

What it does

Sort the keys of every object in a JSON document, at every depth, while arrays keep their order. Normalising two API or RDAP responses this way makes a diff show only real changes.

It runs entirely in your browser: nothing you enter is uploaded.

Example

RDAP-style record

Input
{"status":"active","ldhName":"login.example.com","Registrar":"Example Registrar","events":[{"eventDate":"2026-10-01T00:00:00Z","eventAction":"registration"}]}
Output (captured 2026-10-20)
{
  "Registrar": "Example Registrar",
  "events": [
    {
      "eventAction": "registration",
      "eventDate": "2026-10-01T00:00:00Z"
    }
  ],
  "ldhName": "login.example.com",
  "status": "active"
}

Keys come out as Registrar, events, ldhName, status, with eventAction before eventDate inside the array item; capital letters sort before lowercase.

FAQ

What exactly is sorted?

The keys of every object at every level, including objects inside arrays; the order of array items never changes. The result is printed with 2-space indentation.

Why is the order not what I expected?

Keys are compared by UTF-16 code units, not alphabetically by locale, so uppercase sorts before lowercase and item10 before item9. Keys that look like array indexes ("9", "10") always come first in numeric order, because that is how JavaScript objects store them.

Is the JSON uploaded?

No. Sorting runs in your browser and nothing is sent.