📋 Table of Contents
2. The 64-Bit Float Trap: IEEE 754 and Integer Truncation
In the official JSON specification, numbers are arbitrarily sized decimals. However, JavaScript parses all JSON numbers as IEEE 754 double-precision floating-point values:
Number.MAX_SAFE_INTEGER = 9007199254740991; // 2^53 - 1
JSON.parse('{"id": 9007199254740999}'); // yields {"id": 9007199254741000} (CORRUPTED!)
When dealing with 64-bit database identifiers (Twitter Snowflake IDs, database primary keys), always serialize identifiers as strings to prevent silent numeric corruption.
Format and Validate JSON Cleanly
Clean up messy JSON, check syntax errors, and inspect nested structures in an instant sandbox.
Open JSON Formatter →