🧾 JSON Key Sorter β€” Stable Object Keys

Paste a JSON document to rewrite object keys in alphabetical order. Arrays keep their order. Invalid JSON is reported instead of guessed.

JSON Free Β· no sign-up Added 2026-10-08
Input
Result
Summary

Private by design. This tool runs entirely in your browser β€” nothing you enter or add is uploaded to any server.

How it works

  1. Paste a JSON object or array.
  2. Press Sort keys. Objects are rebuilt with keys sorted by UTF-16 code unit. Arrays stay in place.
  3. Copy the two-space pretty print. The original text is not changed.

Examples

  • {"b":1,"a":2} becomes an object with a then b.
  • Nested objects are sorted at every level.
  • [{"z":1,"a":2}] sorts keys inside the object and keeps the array.

Frequently asked questions

Does sorting change values?

No. Only object key order changes. Numbers, strings and array order stay the same. Duplicate keys follow the browser JSON parser, which keeps the last value.

Is key order meaningful in JSON?

Parsers may ignore object key order. Sorting is still useful for diffs and reviews.

Is the document uploaded?

No. Parsing and sorting run in the page.

More JSON tools β†’