Visual RFC.
ALL RFCs / RFC 8259
Read the RFC ↗
RFC 8259 / JSON BUILDING BLOCKS

Numbers and precision

04

The grammar allows decimal numbers with optional minus, fraction, and exponent, but implementations have numeric limits.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

DIAGRAM§ 6 ↗
RFC 8259 · § 6EXAMPLE
3 / 3
Numbers and precisionA decimal number is divided into grammar components, invalid tokens are rejected, and the binary64 exact-integer interoperability range is shown.Number syntax is not unlimited precisionIllustrative JSON number token-minus12integer.5fractione+2exponent01NaNInfinityThese are invalid number tokens−(2^53)+1(2^53)−1Exact integer agreement with binary64 implementationsChoose values within an agreed precision and range
03
Respect the receiving numeric model.

A valid token can still exceed the receiver’s range or lose expected precision.

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
KEY POINT

Choose numeric ranges the receiver can represent.

  • Leading zeroes, NaN, and Infinity are not valid JSON number forms. A leading plus is not allowed.
  • Parsers may limit accepted magnitude and precision; a syntactically valid token such as 1E400 can exceed common capabilities.
  • With IEEE 754 binary64 implementations, integers from −(2^53)+1 through (2^53)−1 are interoperable with exact agreement.
DETAILS

The RFC describes broad interoperability, not a promise that every runtime accepts the same arbitrary-precision numbers. Applications needing large identifiers often define a string representation in their own schema.

Read the RFC section ↗

Diagrams simplify the RFC. Read the linked sections for complete requirements.

Privacy
All chapters in this RFC
  1. A tree of JSON values
  2. Objects and arrays
  3. Strings and Unicode
  4. Numbers and precision
  5. Parsing and generating
  6. Interoperability checks
RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗