{ }jsonkit
Format
Validate
Convert
Query
Generate
JCS

JSON Canonicalizer & SHA-256

Create RFC 8785 canonical bytes with an optional SHA-256 digest.
99 B · paste or drop a file
1 2 3 4 5 6 7 8 9 10 11 12
✓ complete99 B → 45 B0.0 ms

About JSON Canonicalizer + Hash

The JSON Canonicalizer serializes data with the JSON Canonicalization Scheme from RFC 8785, producing deterministic bytes for hashing, signing, caching and exact comparisons.

Enable SHA-256 to see the digest without mixing it into the canonical output. Copy and Download always return only the canonical JSON bytes.

How it works

RFC 8785 key ordering

Object keys are sorted recursively by UTF-16 code units while array order remains unchanged because array position is meaningful.

Canonical primitives

Whitespace is removed and strings and numbers use ECMAScript JSON serialization, including normalized exponent and negative-zero behavior.

Digest over exact output

The optional SHA-256 value is computed from the UTF-8 bytes of the canonical string shown below it.

Frequently asked questions

Is this the same as alphabetically sorting keys?

It also standardizes whitespace, number formatting and string escaping. Those details matter for signatures and hashes.

Are arrays sorted?

No. RFC 8785 preserves array order.

Why are lone Unicode surrogates rejected?

RFC 8785 requires valid Unicode scalar data so different implementations cannot serialize malformed strings differently.

Sources & last verified

The behaviour of this tool and the claims on this page were checked against the specifications below on . Everything runs in your browser, so the output you see is exactly what the engine produced.

Found a wrong result or an outdated claim? Report an error and it will be re-verified.