T
DataToolings

JSON Key Sorter

Recursively sort all JSON object keys alphabetically. Ascending or descending order, nested objects included.

Valid JSON

What Is JSON Key Sorter?

JSON Key Sorter recursively sorts all object keys in a JSON document alphabetically. This makes JSON easier to read, diff, and version-control — consistent key ordering means cleaner git diffs and easier manual comparison.

How to Use

  • Paste your JSON into the input area
  • Choose ascending (A→Z) or descending (Z→A) sort order
  • The sorted JSON appears instantly in the output
  • Copy the result with the Copy button

Features

  • Recursive sorting — nested objects are sorted at every depth
  • Arrays are preserved in their original order
  • Ascending (A→Z) and descending (Z→A) modes
  • Preserves all JSON types: strings, numbers, booleans, null, arrays, objects

FAQ

Are arrays sorted?

No. Array element order is meaningful in JSON and is preserved. Only object keys are sorted.

Why sort JSON keys?

Consistent key ordering makes JSON files easier to diff in version control, simplifies manual comparison, and can improve readability in large configuration files.

Does this change the data?

No. JSON objects are unordered by spec, so sorting keys does not change the semantic meaning of the data — only its presentation.