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

A tree of JSON values

01

A JSON text is one value with optional surrounding whitespace, and that value can contain nested values.

Related RFCs and changes

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

DIAGRAM§ 2 ↗
RFC 8259 · § 2EXAMPLE
3 / 3
A tree of JSON valuesAn object value expands into name and flags members, then into string, boolean, and null leaves.A JSON text contains one valueIllustrative value treeobject"name""flags"array [ ]"Ada"truenullObjects and arrays nest; scalar values are leavesRead the scalar values at the leaves
03
Reach primitive values.

Strings, numbers, booleans, and null terminate branches of the tree.

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

JSON is data with a small grammar.

  • Values are object, array, number, string, true, false, or null. Literal names are lowercase.
  • A top-level text can be any JSON value, including a scalar.
  • Only space, tab, carriage return, and line feed are insignificant JSON whitespace. Comments and trailing commas are outside the grammar.
DETAILS

JSON syntax is language-independent. A JavaScript expression that happens to resemble JSON can still be invalid JSON.

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 ↗