JSON Cheat Sheet
Every JSON syntax rule, data type, and common mistake on a single page. Bookmark it, print it, share it with your team.
Data Types
"hello world"Double quotes only, never single
42, -3.14, 1.2e10No leading zeros, no quotes
true, falseLowercase, no quotes
nullLowercase, represents empty value
{ "key": "value" }Unordered key/value pairs
[1, 2, 3]Ordered list, mixed types allowed
Syntax Rules
- Keys must be strings wrapped in double quotes
- Strings use double quotes (") — single quotes are invalid
- No trailing commas after the last element
- No comments (// or /* */) are allowed
- No undefined, functions, or dates as native types
- Numbers cannot have leading zeros (01 is invalid)
- The top-level value can be an object, array, string, number, boolean or null
- Whitespace between tokens is ignored
Common Mistakes (Invalid vs Valid)
{ name: "John" }{ "name": "John" }Keys need double quotes
{ 'name': 'John' }{ "name": "John" }Use double, not single quotes
{ "age": 30, }{ "age": 30 }No trailing comma
{ "x": undefined }{ "x": null }undefined is not valid JSON
{ "n": 01 }{ "n": 1 }No leading zeros
{ "v": .5 }{ "v": 0.5 }Digit required before decimal
Escape Sequences
\"Double quote\\Backslash\/Forward slash (optional)\nNew line\ Tab\rCarriage return\Backspace\Form feed\uXXXXUnicode character (hex)Complete Example
{
"id": 123,
"name": "John Doe",
"isActive": true,
"balance": 1500.50,
"middleName": null,
"roles": ["admin", "user"],
"address": {
"city": "Paris",
"zip": "75001"
},
"tags": [],
"lastLogin": "2026-01-15T10:30:00Z"
}Frequently Asked Questions
No. The JSON specification does not allow comments. For config files that need comments, use JSONC or YAML, or add a dedicated property such as "_comment".
No. All strings and keys must use double quotes. Single quotes will cause a parsing error.
String, number, boolean, null, object and array. It does not have native types for dates, undefined, or functions.
No. A comma after the last element of an object or array is invalid and will fail to parse.
JSON is a text format with stricter rules: keys must be quoted strings, only double quotes are allowed, and there are no functions, comments, or trailing commas.
Put This Cheat Sheet to Work
Use our free online tools to format, validate and fix your JSON instantly. No signup required.
JSON Formatter
Format and beautify JSON with proper indentation.
JSON Validator
Validate JSON syntax with detailed error messages.
JSON Minifier
Compress JSON by removing whitespace to reduce size.
JSON Beautifier
Turn minified JSON into clean, readable code.
CSV to JSON
Convert CSV data into JSON for APIs and apps.
Learn More
Detailed fixes for the most frequent JSON syntax errors.
Read guideNaming conventions, structure and security tips for JSON.
Read guide