Six values, no exceptions
JSON has exactly six value types: string, number, boolean, null, object, array. That is the entire vocabulary. Every JSON document, no matter how nested, is built from these six.
What JSON does NOT have
- No
undefined— JavaScript has it, JSON doesn't. Usenullfor missing values, or omit the key entirely. - No functions — JSON is data, not code.
- No comments — Crockford removed them deliberately. Use a separate doc file or layered formats (JSON5, JSONC) if you need them.
- No native dates — dates are strings, by convention ISO 8601 (
2026-05-04T01:30:11Z). - No BigInt — numbers are IEEE 754 floats. Above 253, integers lose precision silently.
- No regex, no Map, no Set — JS-specific types serialize as plain objects/arrays.
Implication: JSON is not a perfect mirror of any language
Every language has to map its native types onto JSON's six. Python's tuples become arrays. JavaScript's undefined becomes either null or absent. Dates become ISO strings. Round-tripping requires a convention, not just JSON.stringify.
The 'JSON has dates' lie: ECMAScript's
JSON.stringify on a Date produces an ISO string; JSON.parse on that same string produces a string, not a Date. Round-trip fails. Use a reviver function or schema validation if you need real dates.