JSON Data Types

JSON has six value types: object, array, string, number, boolean and null.

Object

An unordered set of key/value pairs. Keys must be strings.

{"name":"Ada","role":"admin"}

Array

An ordered list of values. Values may be mixed in JSON, though most schemas prefer a single type.

["json", "yaml", "csv"]

String

Double-quoted Unicode text with escape sequences such as \n, \t and \".

"line one\nline two"

Number

An integer or decimal number in base 10. Leading zeros, hexadecimal and NaN are not valid JSON.

42

Boolean and null

Use lowercase true and false. Use null for an intentionally empty value.

true