JSON Tools

JSON Sort Keys

Paste your JSON below to recursively sort every object's keys alphabetically.

What does this tool do?

It recursively walks your JSON and rewrites every object with its keys sorted alphabetically, in either ascending or descending order, while leaving values and array ordering untouched.

How to use this tool

  1. Paste your JSON into the left-hand box.
  2. Choose ascending or descending order.
  3. Click Sort Keys to get the reordered JSON.

Frequently asked questions

Does sorting keys change my data?

No — only the order of keys within each object changes. Values, array order, and nesting stay exactly the same. JSON objects are inherently unordered, so reordering keys doesn't affect how the data is interpreted.

Does it sort keys inside nested objects too?

Yes — sorting is recursive, so every object at every level of nesting gets its keys alphabetized, including objects inside arrays.

Why would I want sorted keys?

Sorted keys make JSON easier to scan, produce cleaner diffs when comparing two versions of a document, and make it easier to spot missing or extra fields.