Developer

JSON Sort and Minify

Sort JSON keys alphabetically and minify in one click.

All tools

Input

Output

{
  "a": {
    "b": 3,
    "y": 2
  },
  "z": 1
}

Frequently asked questions

Does sorting JSON keys break anything?
No, JSON objects are defined as unordered key-value sets, so any consumer that respects the spec will read the sorted version identically. Sorted output is just easier to diff and cache.
Why would I want canonical sorted JSON?
Canonical JSON gives a deterministic byte representation, which lets you hash it for signatures, integrity checks, or cache keys. Without sorting, two semantically equal payloads can produce different hashes.
Does minifying JSON affect what numbers or strings it can hold?
No, minifying only removes insignificant whitespace - all values, types, and escapes are preserved exactly. The parsed result is byte-for-byte equivalent to the pretty version.