Web Content & Formats
What is JSON?
JavaScript Object Notation, a lightweight text format for representing structured data, supported natively by every modern language.
JSON is the lingua franca of web APIs. Six data types (string, number, boolean, null, array, object) are enough to encode almost any tree-shaped data, and the syntax is small enough to parse with a 200-line state machine. That tradeoff (small grammar, broad coverage) is why JSON beat XML for API payloads in the early 2010s and never gave the territory back.
In practice you never write a JSON parser. Every language ships one, JSON.parse in JS, json.loads in Python, serde_json in Rust, encoding/json in Go, and the rough edges (huge integers, NaN, dates) come from corner cases the spec doesn't cover.
JSON Schema, JSON-LD, and JSONL extend the format for validation, semantic linking, and streaming respectively. Each is just JSON with conventions layered on top, same parsers, same tooling.
In the wild
- →
{"name": "Stripe", "domain": "stripe.com"} - →
[{"id": 1}, {"id": 2}], an array of objects - →
{"colors": ["#635BFF", "#0A2540"]}
How Brand.dev uses json
Endpoints in the Brand.dev API where this concept comes up directly.
FAQ
JSON vs XML?
JSON is smaller, faster to parse, and maps directly onto JavaScript objects. XML supports namespaces, attributes, and schemas more richly. For new APIs, JSON. For document interchange in regulated industries, XML still shows up.
Is JSON case-sensitive?
Yes. "Name" and "name" are different keys. By convention API JSON uses snake_case or camelCase consistently.
Why doesn't JSON support comments?
Crockford left them out on purpose to keep parsers simple. JSONC and JSON5 add comments back; standard JSON does not.
Related terms
An API that follows REST conventions, using HTTP methods on resource URLs to model create/read/update/delete operations.
JSON for Linking Data, a way to embed schema.org structured data into a page using plain JSON in a `<script type="application/ld+json">` block.
An Application Programming Interface, a contract that lets one program request actions or data from another in a stable, documented way.
A query language for APIs that lets the client specify exactly the fields it wants from a typed graph of data, returned in one round trip.