JSON (JavaScript Object Notation) is a lightweight, text-based format for representing structured data as key-value pairs, arrays, strings, numbers, booleans, and null. It grew out of JavaScript's object literal syntax but is language-independent — every mainstream language has a JSON parser, and the format is standardized in RFC 8259 and ECMA-404.
A JSON document is built from six value types nested inside two container types:
{ "key": value, ... }, unordered sets of string-keyed pairs[value, value, ...], ordered listsNaN/Infinity), true, false, and nullThere is no comment syntax, no trailing commas, and no way to represent dates, binary data, or undefined natively — a frequent source of friction when porting JavaScript objects to JSON. Whitespace between tokens is insignificant, which is why a minifier can strip it to shrink payload size without changing meaning, while a "pretty-print" step reintroduces indentation for readability.
Example:
{
"id": 42,
"name": "Ada Lovelace",
"tags": ["math", "computing"],
"active": true,
"manager": null
}
Number.MAX_SAFE_INTEGER, 2^53−1) silently lose precision when parsed into a JavaScript number.\uXXXX); a mismatched encoding produces mojibake, not a parse error.