Free online JSON key sorter supporting ascending/descending order and recursive sorting of nested structures for easy diffing and code review. Local processing only.
TL;DR: Free online JSON key sorter that arranges object keys in ascending or descending order with optional recursive sorting of nested structures. Values stay untouched for easy diffing and code review. Processed locally, no uploads.
For local tools, open DevTools → Network and search your input — it should not appear in requests.
Next steps
Usage Guide
Sort JSON object keys asc/desc with optional recursion; arrays keep order — local.
1. Sort
Representation only; fix parse errors first.
- Paste JSON.
- Asc or desc; recurse if needed.
- Copy or download.
2. When
- PR diffs.
- Goldens.
- Before flatten.
- Multi-env exports.
3. Arrays
Nested keys sort; arrays never reorder.
4. Big ints
- Indented output.
- Lossless integers.
- Huge docs use CLI.
5. Team
Pick one pipeline and stick to it.
6. Vs formatter
- Pretty there.
- Stable keys here.
7. Reminder
Key-order normalization is reviewability engineering.
FAQ
No. Everything on this page runs locally in your browser — your content is never uploaded, and no registration is needed.
Sort object keys in ascending or descending order, with an optional recursive mode that also sorts keys inside nested objects — handy for config comparison and baseline normalization.
No. Arrays keep their original order; only object keys are sorted, so list semantics like timelines and priority queues survive. Objects inside an array still get their own keys sorted. If you need object arrays sorted by a field, that is business sorting — use a script or a data-processing tool, not this page.
The tool reports the parse failure with details such as position and error type, so you can locate and fix the syntax first, then sort.
Very large integers are serialized losslessly and never silently altered by floating point; the output is indented by default, and a minify step can produce a single line later. Million-line documents, however, will strain browser memory — switch to a command-line tool at that scale.
Unify key order before diffing two configs in a merge request and the noise shrinks dramatically; normalize before generating baseline files so tests do not fail on key order alone. If you just need pretty indentation and syntax validation, use the JSON formatter; if you need stable key order for diffing or baselines, use this page. Teams should fix one pipeline order — format-then-sort or sort-then-format — write it into the contribution guide, and never mix the two.
Related Tools
Related Articles
JSON Integer Precision Trap: When Snowflake IDs Are Silently Rewritten
JSON numbers beyond 2^53-1 are rounded by JSON.parse. Compare naive formatters with a lossless path, and cross-link JWT, Base64, and this site’s JSON tools.
JSON Parse Error 'Unexpected token'? 5 Common Causes and How to Fix Them
Getting a JSON parse error 'Unexpected token'? This article covers the 5 most common causes of JSON format errors — trailing commas, single quotes, unescaped characters, BOM headers, and comments — with fixes and code examples for each.
Unexpected token '<' is not valid JSON — 5 Reasons Your API Returned HTML Instead
fetch throws SyntaxError: Unexpected token '<' when the response body is HTML, not JSON. Covers the 5 root causes: SPA history fallback returning index.html, auth 302 redirects, gateway 502 error pages, wrong baseURL, and missing res.ok checks — with curl diagnostics.