JSON Number Precision
Check JSON number precision
Find integers, decimals, exponents, overflow, and notation that JavaScript Number may change.
JSON numbers are not limited to JavaScript Number
JSON defines number syntax, not a universal machine representation. JavaScript Number uses IEEE 754 double precision, so large integers can round, extreme exponents can overflow or underflow, and valid notation can be normalized.
The checker compares every source number with a JavaScript Number round trip while Best JSON Formatter keeps the original token unchanged.
How to use this tool
- Paste JSON containing the numbers your system exchanges.
- Review rounding, overflow, underflow, and notation findings by path.
- Change the contract or consumer before transmitting an unsafe value.
Example
Input
{"id":9007199254740993}Result
$.id rounds to 9007199254740992 as a JavaScript Number.Common problems
- A syntactically valid JSON number can still exceed a consumer's numeric range.
- Formatting should never be used as proof that numeric values survived parsing.
- Scientific notation can preserve value while losing its original spelling.
Useful tips
- Keep identifiers as strings when consumers cannot preserve integers.
- Test the exact receiving parser, not only the producer.
- Preserve original number text during format and conversion.