23 chars · 1 line
37 chars · 3 lines
23 chars · 1 line
37 chars · 3 lines
Query builder numeric safety error
JavaScript numbers cannot represent every integer above Number.MAX_SAFE_INTEGER exactly. The query builder rejects unsafe integer values rather than serializing a number that may already have been rounded by JSON.parse. This tool is free to use. No account or payment is required.
Last updated
JSON.parse converts JSON numbers to JavaScript Number values. An unsafe integer may already differ from the decimal digits in the source before URLSearchParams receives it.
Representing large identifiers as strings avoids numeric coercion and preserves the original sequence of digits.
The string form is safe for an exact identifier.
{"id":9007199254740993}{"id":"9007199254740993"}Common questions
It is an integer that can be represented exactly within Number.MIN_SAFE_INTEGER through Number.MAX_SAFE_INTEGER.
Large identifiers are often better represented as strings when arithmetic is not required.
The generated parameter still contains the digits, but the JSON parser no longer rounds them as a Number.
Debugging a specific Query String issue? Browse Query String troubleshooting.