What is JSON? Syntax & Specifications.
A comprehensive guide to JavaScript Object Notation (RFC 8259).
JSON (JavaScript Object Notation) is a lightweight, language-independent data interchange format. Derived from the JavaScript object literal syntax, JSON is now supported natively in virtually all modern programming languages.
Supported Data Types
| Type | Example | Description |
|---|---|---|
| String | "hello world" | Enclosed in double quotes only. |
| Number | 42, -3.14, 1e5 | Integer or floating point. |
| Boolean | true / false | Lowercase boolean literal. |
| Null | null | Explicit empty value. |
| Object | { "key": "val" } | Unordered key-value collection. |
| Array | [1, 2, 3] | Ordered sequence of values. |
Key Syntax Rules
- All object keys must be wrapped in double quotes (e.g.
"id": 123). - Single quotes are strictly disallowed.
- Trailing commas after the last key or element are illegal in standard JSON.
- Comments are not permitted in strict RFC 8259 JSON.