JSON Forge
100% Client-Side: your data is never sent to a server

JSON Syntax Cheat Sheet

Everything you need to write valid JSON on one page. Use your browser's print command (Ctrl+P) to save it as a PDF.

The six value types

TypeRuleExample
objectKey and value pairs in { }. Keys are strings in double quotes.{"name": "Ada", "age": 36}
arrayAn ordered list in [ ], items separated by commas.[1, 2, 3]
stringText in double quotes. Single quotes are not allowed."hello"
numberInteger or decimal, optional minus and exponent. No NaN, Infinity or leading zeros.-12.5e3
booleanLowercase true or false, no quotes.true
nullLowercase null, an explicit empty value.null

String escapes

A backslash starts an escape. Any other character after a backslash is an error.

EscapeMeaningExample
\"Double quote"say \"hi\""
\\Backslash"C:\\Users"
\/Slash (optional)"a\/b"
\n \r \tLine feed, carriage return, tab"line1\nline2"
\b \fBackspace, form feed"\b"
\uXXXXAny character by its four-digit hex code"\u00e9" is é

Not allowed in JSON

Not allowedWhyUse instead
Comments (// or /* */)JSON has no comments.A "_comment" key, or JSONC/YAML
Trailing commasA comma after the last item is an error.Remove the last comma
Single-quoted stringsOnly double quotes are valid."text"
Unquoted keysKeys must be strings.{"key": 1}
undefined, NaN, InfinityThey are not JSON values.null, or a string
Raw line breaks inside stringsControl characters must be escaped.\n
Multiple top-level valuesA document has exactly one value.Wrap them in an array

Good to know

Validate your JSON · All cheat sheets · JSON examples