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

Can a reader keep every digit of a number?

04

Compare written digits with a common reader’s stored result, then try sending an identifier as text.

RFC 8259 · § 6EXAMPLE
1 / 4 · Someone writes down a number

We want the receiving app to keep the intended value. A very large identifier may need every written digit.

Written digits

9007199254740993

A finite storage format has room for only some possible numbers.

What happens if you change this?

Make one change, then watch again. Restart restores the original example.

3 / 3
03
Respect the receiving numeric model.

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

Can a reader keep every digit of a number?A 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

Key idea: A number can be spelled correctly and still be too large or precise for a reader. Agree on the value type and capacity.

Terms
JSON
JavaScript Object Notation: shared rules for writing data as text. Apps in many languages use it.
Object
A group of named values, like drawers with different labels.
Array
A list whose values have meaningful positions.
String
A text value between quotation marks.
Grammar
Rules for which marks and words may appear and where.
Interoperability
Different apps can read the same data and agree about its meaning.
Binary64
A common number storage format with finite space. Near very large numbers it cannot represent every neighboring integer.
Precision
How much detail a stored number can keep without rounding it away.

Look up a term in the glossary ↗

Rules & examples

Correct spelling and the reader’s numeric capacity are separate checks.

  • Extra leading zeroes in the integer component, NaN, and Infinity are not valid JSON number forms. A leading plus is not allowed. Fractional zeros and exponent zeros are allowed (verified erratum 7600).
  • 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.

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.

RFC 8259 §6: number = optional minus, integer, optional fraction and exponent. Extra leading zeros in the integer component are forbidden; 0.001 and 1E01 are valid (verified erratum 7600). NaN and Infinity tokens are forbidden; 1E400 is grammatical but problematic. In binary64, integers in [−(2^53)+1, (2^53)−1] have exact interoperable agreement. Not every integer beyond this interval is inexact. This example uses JavaScript binary64; strings need an application convention.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

First, agree how to read the message.

An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

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

All chapters in RFC 8259

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

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

RFC status and corrections ↗