"hello"Strings must use double quotes in standard JSON.
Examples and edge cases for strings, numbers, booleans, null, arrays, and objects in JSON.
JSON has a small, fixed set of primitive value types.
"hello"Strings must use double quotes in standard JSON.
123.45JSON has a single number type; parsers may map it differently by language.
true`True` and `False` are invalid in JSON.
nullUseful for partial updates, missing values, and API responses.
{
"enabled": false,
"nickname": null
}`false` means the feature is disabled. `null` means there is no value.
Common JSON number formats that trip people up.
{
"count": 7
}`007` is invalid JSON.
{
"distance": 1.23e6
}Useful for large or very small numeric values.
{
"value": 0
}Some JavaScript values do not serialize into standard JSON as raw literals.
jq 'type' <<< '123'Helpful when checking how a parser sees a value after serialization.
Escapes, Unicode, and practical string examples.
Use backslash to include literal double quotes.
{
"message": "She said \"hello\""
}Unescaped double quotes end the string and break parsing.
Encode newlines and tabs inside strings.
{
"text": "line 1
line 2\tindented"
}Use escaped characters rather than raw line breaks inside a JSON string.
{
"currency": "\u20AC"
}`€` represents the euro symbol.