RFC 8259 / START HERE
JSON, before the details
JSON: JavaScript Object Notation
JSON is a text format for structured data: objects, arrays, strings, numbers, and a few simple values. It is used far beyond JavaScript.
The idea in one picture
An app has structured values
JSON writes them as text
Another app reads the values
A simplified picture of the idea; the chapters explain the actual mechanisms.
Why it exists
Applications written in different languages need a small, widely understood way to exchange structured information.
A familiar example
A weather API returns an object containing a city name, temperature, and forecast list.
Helpful background
You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.
What you’ll learn next
Begin with chapter one, or choose a topic.
- A tree of JSON valuesA JSON text is one value with optional surrounding whitespace, and that value can contain nested values.→
- Objects and arraysObject members map string names to values. Arrays retain an ordered sequence of elements.→
- Strings and UnicodeQuotes delimit strings; escapes represent special characters without changing the intended string value.→
- Numbers and precisionThe grammar allows decimal numbers with optional minus, fraction, and exponent, but implementations have numeric limits.→
- Parsing and generatingA parser builds an internal representation from text. A generator must produce text that strictly follows JSON grammar.→
- Interoperability checksSmall choices around names, strings, numeric limits, and media type determine whether independent implementations agree.→
This introduction explains RFC 8259 (2017). Read the original RFC ↗