All tutorials
The Six JSON Data Types
JSON has exactly six data types. Understanding these is the foundation of working with JSON.
String
A sequence of characters wrapped in double quotes. Use backslash for escaping: \" for quotes, \\ for backslash, \n for newline.
"Hello, World!""Escaped: \"quote\" and \\backslash\\""Line 1\nLine 2"Number
Integers or decimals. No quotes. Scientific notation allowed.
423.14
-100
1.5e10Boolean
Logical values. Must be lowercase: true or false.
truefalseNull
Represents absence of value. Always lowercase null.
nullObject
Unordered collection of key-value pairs in curly braces. Keys must be strings.
{"name": "Alice", "age": 30, "active": true}Array
Ordered list of values in square brackets. Values can be any type.
["red", "green", "blue"][1, 2, 3, 4, 5][true, false, null]stringnumberbooleanobjectarray