JSON data types: a complete reference
string, number, boolean, null, array, object — what's allowed in each, with edge cases.
What are the data types in JSON?
JSON has exactly six: string, number, boolean, null, array, and object. There is no separate integer or float type (all numbers are one type), no date type, and no undefined — dates are conventionally sent as ISO 8601 strings.
Strings
Sequences of Unicode code points enclosed in double quotes. Use escape sequences for control characters and quotes.
Numbers
Integers or floats in standard notation. No NaN, no Infinity, no leading zeros, no plus sign before the integer part. Languages may parse very large numbers as floats and lose precision — for IDs prefer strings.
Booleans
Lowercase true or false.
null
Lowercase null. Distinct from missing — { "x": null } has the key, {} does not.
Arrays
Ordered list in square brackets, comma-separated, may mix types. Empty array is [].
Objects
Unordered (in spec) collection of double-quoted string keys mapped to values. Keys should be unique. Empty object is {}.
For a deeper look at the two container types, see the guides on JSON arrays and JSON objects.
Explore the structure in the tree viewer →
Expand nested arrays and objects, see every type at a glance, and click any node to copy its JSONPath.
Open Tree Viewer →