Visual RFC.
ALL RFCs / RFC 7493
Read the RFC ↗
RFC 7493 / Internet JSON interoperability

Keep number expectations within binary64

02

Different runtimes can round the same JSON number. Separate a recommendation about numbers from a promise of exact identifiers.

RFC 7493 · § 2.2EXAMPLE
4 / 4
Keep number expectations within binary64RFC advice is SHOULD NOT for1E400; a separate chosen binary64-only receiver stops acceptance. This does not turn the advice into a universal MUST reject.Choose realistic number expectationsChosen token: 1E400Beyond finite binary64 magnitudeRFC advice: SHOULD NOT include itChosen binary64-only consumer refusesLocal acceptance policy, not a universal MUST rejectAdvice ≠ syntax ban · strings need agreed semantics
04
Separate advice from rejection

The RFC says SHOULD NOT send such values. A separate illustrated binary64-only consumer refuses acceptance under its chosen contract.

Source for this drawing: RFC 7493 · Read RFC section 2.2 ↗

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.

KEY POINT

An exact decimal identifier needs an agreed representation, not hope about a receiver’s number type.

  • IEEE754 binary64, often called double precision, is widely available. I-JSON senders cannot assume a receiver supports greater magnitude or precision. Messages SHOULD NOT include numbers expressing more than binary64 provides, such as 1E400 or the RFC’s long decimal π example (§2.2). This is SHOULD NOT, not a universal grammar ban or MUST reject.
  • The published interoperability statement uses the consecutive-integer interval −9007199254740991 through9007199254740991, or ±(2^53−1). A sender cannot expect integers outside it to arrive as exact values. Some individual integers outside it are representable; the interval is not the entire range of finite binary64 numbers (§2.2).
  • The illustrative decimal integers9007199254740992 and9007199254740993 both become9007199254740992 in JavaScript Number. That demonstrates a collision, not a claim that every out-of-range integer rounds or is invalid JSON. Reported technical erratum5354 proposes changing the printed bound to±2^53; it is unverified and is not adopted here.
  • For applications requiring exact exchange of larger or higher-precision numbers, JSON strings are RECOMMENDED. The example {"id":"9007199254740993"} preserves its digits, but the receiving program must know this string is an identifier or exact number. A string alone supplies no arithmetic semantics (§2.2).
  • The bounded helper retains raw numeric tokens and shows their JavaScript interpretation; it reports selected binary64 magnitude/safe-integer advice separately from profile MUST violations. A chosen exact-ID consumer can stop a numeric value that cannot satisfy its contract. That local decision is not a universal I-JSON error response.
DETAILS

Offline illustrative messages and bounded helpers, not a production parser, full calendar validator or authentication protocol. Reported errata are not adopted as verified corrections.

Read the RFC section ↗

All chapters in RFC 7493

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 ↗