JSON Canonicalizer

Turn equivalent JSON documents into one deterministic, compact representation. Object keys are sorted recursively by RFC 8785's UTF-16 ordering; array order and JSON values stay intact. Nothing leaves your browser.

Canonical JSON
Canonical JSON appears here.
Paste JSON to begin.
What does canonical JSON change?
  • Whitespace is removed, so pretty-printed and minified input produce the same output.
  • Object keys are sorted recursively by their raw UTF-16 code units. Arrays keep their original order.
  • Numbers use the browser's JSON serialization. Non-finite values are not valid JSON and are rejected.
  • Canonicalization is useful as a stable input to hashing or signing, but this tool does not hash or sign the result.