W050Warning

Integer loses precision

A large integer exceeds JavaScript’s safe range.

What it means

JavaScript numbers are IEEE-754 doubles, so integers beyond 2^53 (9,007,199,254,740,992) cannot be represented exactly. Large IDs such as Twitter/X snowflake IDs silently round to a different value when parsed as numbers.

Example

Invalid
{ "id": 12345678901234567890 }
Valid
{ "id": "12345678901234567890" }

How to fix it

Store large IDs as strings, or parse with a lossless-number option.

Validate your JSON to see this and every other issue highlighted in one pass.


Diagnostics on this page come from @jsonlint/core, the open-source engine that powers the JSONLint validator. Install it with npm install @jsonlint/core.