JSON Key Sorter
Sort JSON object keys recursively by alphabet, case or value type with ascending/descending order and configurable indentation. Free, instant and fully client-side.
Loading tool...
What is JSON Key Sorter?
A JSON Key Sorter recursively rewrites JSON objects with their keys in a consistent order β alphabetical, case-sensitive, or grouped by value type β so repeated runs of the same data always produce byte-identical output for snapshot tests, fixtures and readable diffs.
Key Benefits
- Deterministic output for snapshot tests and golden files
- Diffs that show real changes instead of shuffled keys
- Sorted config and translation files that are easier to scan and review
Common Use Cases
- β’Normalizing API fixtures before committing them to a repository
- β’Preparing stable JSON for snapshot or golden-file testing
- β’Tidying hand-maintained config, i18n and manifest files
How to sort JSON keys
- Paste your JSON: Drop the JSON document, API response or config file into the input box β any valid JSON works, at any nesting depth.
- Pick the sort mode: Choose case-insensitive or case-sensitive alphabetical order, or group keys by value type, then set the direction and indentation.
- Copy the stable output: The sorted JSON updates live β copy it back to your snapshot test, fixture or config for deterministic diffs.
Key Features
- Recursive key sorting for objects nested anywhere, including inside arrays
- Case-insensitive alphabetical mode with case-sensitive tie-breaking
- Value-type ordering: null, boolean, number, string, array, object
- Ascending or descending order plus 2/4-space or tab indentation
- Live re-sorting as you type with exact JSON parse error messages