JSON Cheat Sheet
Everything you need to know about JSON syntax — data types, structure rules, escaping, and common patterns — in one quick reference.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON Cheat Sheet?
JSON (JavaScript Object Notation) is the universal data interchange format used by REST APIs, configuration files, and databases. It is simple but strict: no comments, no trailing commas, only double-quoted strings, and only six data types.
This cheat sheet covers all JSON syntax rules, data types with examples, nesting patterns, string escaping sequences, and common mistakes that cause parse errors.
How to Use JSON Cheat Sheet
Common Use Cases
- Developers building or consuming REST APIs who need a quick syntax reminder.
- Students learning JSON for the first time who want a structured reference.
- Developers debugging JSON parse errors who want to check escaping rules.
- DevOps engineers writing JSON configuration files who need a quick lookup.
Example Input and Output
A JSON object demonstrating all six data types.
{
"name": "Alice",
"age": 30,
"active": true,
"score": null,
"tags": ["admin", "user"],
"address": { "city": "London" }
}string, number, boolean, null, array, objectTip: use a validator
When a JSON parse error is hard to find, paste into the JSON Validator tool — it reports the exact line and column of the syntax error.
Frequently Asked Questions
Can JSON have comments?
No. Standard JSON does not support comments. If you need comments in configuration files, consider JSONC (JSON with Comments), JSON5, or YAML instead. Parsers that accept JSON will throw on // or /* */ comments.
Why must strings use double quotes?
The JSON specification (RFC 8259) mandates double quotes for strings. Single-quoted strings are invalid JSON — this is a frequent source of parse errors when copying values from JavaScript code.
Related Tools
JSON Validator
Validate JSON syntax online. Shows valid/invalid status, error location (line and column), and structure stats including type, key count, and depth.
JSON Formatter
Format, validate, and beautify JSON instantly — with clear error messages, Tree View, Diff mode, and Schema validation.
JSON to CSV Converter
Convert a JSON array of objects to CSV. Flattens nested objects with dot-notation columns and handles arrays within values.
YAML Cheat Sheet
A complete YAML reference — scalars, sequences, mappings, multi-line strings, anchors, aliases, and gotchas. Quick lookup for developers working with YAML configs.
CSS Selector Cheat Sheet
A complete reference for CSS selectors — basic, attribute, pseudo-class, pseudo-element, and combinator selectors with syntax and examples.
JSON Cleaner
Clean JSON by removing null values, empty strings, empty arrays, and empty objects. Configurable per value type with a removal count stat.

