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:
- 64-bit integers & arbitrary decimals:
9007199254740992,9007199254740993,-0, and0.123456789012345678901stay exact character-for-character even with Normalized JSON and Sort keys enabled. - Duplicate key detection: Every occurrence stays visible in the normalized output and triggers an explicit warning.
- JSON path inspection: Selecting any changed value shows its JSON path (
booking.attendees,venue.room) alongside exact Content A and Content B values.
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.
folio