JSON Canonicalizer (RFC 8785)

Convert JSON to the JSON Canonicalization Scheme form: the same bytes for the same data, so two parties hash or sign the same sequence.

Any JSON value. Up to 200,000 characters and 128 levels of nesting.

Canonicalization is not signing and not encryption: it only fixes the representation, so a hash or signature taken over the output matches one taken over the same data elsewhere. JCS (RFC 8785) removes all whitespace, sorts every object's property names by UTF-16 code units rather than by locale — so “péché” comes after “peach”, and an emoji sorts by its surrogate pair — and serializes strings and numbers exactly as ECMAScript does, so 1E30 becomes 1e+30 and 4.50 becomes 4.5. Property names are compared in their unescaped form, array order is never changed, and the result is encoded as UTF-8. Numbers are IEEE 754 doubles, so an integer outside ±253 is rounded and the page says so. The scheme's I-JSON rules make it refuse a document with duplicate property names, an unpaired surrogate, NaN or Infinity, or a number too large for a double, because none of those has one interoperable form. The SHA-256 shown is the digest of the canonical UTF-8 bytes, computed in this page; nothing is sent or stored.