Text Tools
JSON for Beginners: The Rules and the 6 Most Common Errors
Quick Work Studio · 2026-10-01
JSON (JavaScript Object Notation) is the most common format for sending data between apps and websites. It's easy to read, but it's also strict, and a single misplaced character makes the whole thing invalid.
What JSON looks like
JSON is built from two structures: objects, which are sets of "key": value pairs inside curly braces { }, and arrays, which are ordered lists inside square brackets [ ]. For example, a person might be written as {"name": "Asha", "age": 29, "skills": ["excel", "sql"], "active": true}.
The six value types
A JSON value can only be one of: a string in double quotes, a number, true or false, null, an object or an array. There are no dates, functions or "undefined", dates are usually stored as strings like "2026-10-01".
The 6 most common errors
- Trailing commas. {"a": 1, "b": 2,} is invalid. The last item in an object or array must not be followed by a comma.
- Single quotes. {'name': 'Asha'} is invalid. Keys and strings must use double quotes.
- Unquoted keys. {name: "Asha"} works in JavaScript but not in JSON. Every key needs double quotes.
- Comments. JSON has no comment syntax, so // notes and /* blocks */ make it invalid.
- Unescaped characters in strings. A double quote inside a string must be written as \", a backslash as \\, and a line break as \n.
- Invalid numbers. Leading zeros (007), NaN and Infinity aren't allowed, and decimals need a digit before the point (0.5, not .5).
Pretty-printed vs minified
The same JSON can be written with indentation and line breaks to make it readable ("pretty-printed"), or with all whitespace removed to make it smaller ("minified"). Both contain exactly the same data, whitespace outside strings doesn't matter.
How to find an error quickly
Validators report the line and position where parsing failed. The real mistake is often just before that point, a missing comma on the previous line, or an unclosed quote or bracket earlier on.
Try it: paste your data into the JSON Formatter & Validator to check it, pretty-print it or minify it. For sending JSON in a web address, the URL Encoder / Decoder can encode it safely.