Need to sort the keys in your JSON objects for consistent formatting, easier diffing, or cleaner version control? This free tool sorts all object keys at every nesting level, producing deterministic, canonical JSON output. Choose ascending, descending, natural, or custom key ordering — all processed in your browser.
Ascending (A→Z), Descending (Z→A), Natural (numeric-aware where key2 comes before key10), and Custom (user-defined priority keys).
Sort keys at all nesting levels, only the top level, or up to a custom depth. Nested objects beyond the limit keep their original key order.
Specify a comma-separated list of keys that should appear first (e.g. id, name, type). Remaining keys are sorted alphabetically after the priority keys.
Numeric-aware sorting where key2 comes before key10. Essential for configuration files with numbered keys.
Optionally sort arrays whose elements are all objects by a specified key value. Great for normalizing lists of records.
All processing runs in your browser. Your JSON data never leaves your device — no server requests, no storage.
Sort keys in package.json, tsconfig.json, or .eslintrc to maintain a consistent, canonical key order across your team. Reduces merge conflicts and makes code reviews easier.
When JSON keys are sorted deterministically, git diffs show only actual value changes — not key reordering. Essential for configuration files stored in version control.
Sort keys in API response payloads before comparing them. Ensures two equivalent JSON responses with different key orders are recognized as identical.
Sort keys in exported JSON documents from MongoDB, CouchDB, or other document databases. Makes large exports more readable and consistent.
Use custom key order to enforce a canonical structure like id → name → type → description in JSON schemas, API definitions, or data models.