JSON
ActiveLightweight, text-based data interchange format derived from JavaScript object syntax. Human-readable, language-independent, and the dominant format for REST APIs, configuration files, and data storage.
In one line
JSON (JavaScript Object Notation) is defined by RFC 8259 and ECMA-404. It encodes structured data as human-readable text using six value types: string, number, boolean, null, array, and object. JSON is the default wire format for REST APIs, webhook payloads, and configuration files. Every major programming language has a native JSON parser.
Quick Reference
| Field | Size | Description |
|---|---|---|
| Encoding | UTF-8 | JSON MUST be encoded as UTF-8. RFC 8259 §8.1. UTF-16 and UTF-32 are no longer allowed. |
| Value types | 6 | string, number, boolean (true/false), null, array, object |
| Whitespace | Ignored | Space, tab, LF, CR between tokens are insignificant. |
| Numbers | IEEE 754 | No integer vs float distinction. Implementations use 64-bit IEEE 754. Integers beyond 2^53 lose precision. |
| Strings | Unicode | Quoted with double quotes. Escape sequences: \", \\, \/, \b, \f, \n, \r, \t, \uXXXX. |
| Object keys | String | Keys MUST be strings. Duplicate keys are undefined behavior. Key order is not guaranteed. |
| MIME type | application/json | RFC 4627 registered application/json. Supersedes text/json. |
Key Characteristics
Human-readable
Plain text, UTF-8 encoded. Readable without tools. Self-describing via key names.
Language-agnostic
Parsers exist in every language. No schema required. Schemaless by default, optional via JSON Schema.
Number precision
No integer type. Numbers are IEEE 754 doubles. Integers beyond 2^53-1 lose precision. Use strings for large IDs.
No comments
JSON has no comment syntax. RFC 8259 explicitly omits comments. Use JSON5 or JSONC for config files needing comments.
Message Format
// JSON value types
{
"string": "Hello, world",
"number": 42,
"float": 3.14159,
"boolean": true,
"null": null,
"array": [1, "two", false, null],
"object": {"nested": "value"}
}// Common JSON API response
{
"id": "user_123",
"email": "[email protected]",
"createdAt": "2026-01-15T10:00:00Z",
"scores": [98, 95, 100],
"metadata": null
}
// Number precision gotcha
{"id": 9007199254740993} // JS parses as 9007199254740992 – use string
{"id": "9007199254740993"} // Safe