folio.

Compare JSON without rounding 64-bit IDs or large numbers

Standard JSON.parse() converts every number into an IEEE-754 double-precision float. Any integer larger than 2^53 - 1 (9007199254740991) silently rounds, making two distinct Snowflake IDs or financial amounts look identical.

Why JavaScript JSON.parse hides real bugs

JSON.parse('{"id":9007199254740992}').id === JSON.parse('{"id":9007199254740993}').id;
// true — precision silently lost

Exponents like 1e400 turn into null under JSON.stringify, and duplicate object keys ({"a":1,"a":2}) silently drop the first entry.

How Folio preserves exact tokens

Folio scans JSON tokens directly rather than round-tripping values through JSON.parse and JSON.stringify:

Open the JSON comparison example

JSON as entered vs. Normalized JSON

Use Normalized JSON when you want consistent 2-space indentation and optional key sorting without rounding numbers. Switch to JSON as entered when exact source whitespace or numeric formatting differences themselves matter.