JSON Sorter & Deduper
Sort object keys recursively, sort array items alphabetically or numerically, and dedupe array items — then pretty-print the result with stats. Runs entirely in your browser.
Input JSON
Options
How it works
- Object keys are sorted recursively with localeCompare, so the whole document — nested objects included — becomes deterministic and diff-friendly.
- Arrays can be sorted ascending or descending. Primitive arrays sort by value; arrays of objects sort by their first key, which keeps records grouped consistently.
- Deduplication removes duplicate array items (primitives by value, objects by their serialized form) and reports how many were dropped.
- If the input is invalid, the error message points to the exact line and column of the problem.
About JSON Sorter & Deduper
Unsorted JSON is hard to eyeball: equivalent documents differ, review diffs grow noisy, and duplicate entries inflate payloads. A deterministic sort turns a hand-edited blob into a canonical form you can diff, cache, or commit with confidence.
Use it to normalize config files before committing, to shrink response payloads by removing duplicate items, or to prepare stable fixtures for tests and examples. Sorting and deduplication happen locally, so private schemas and payloads never leave your browser.