Last updated:
What JSON is
JSON (JavaScript Object Notation) is a text format for structured data. APIs, configuration files and many apps use it because it is easy for both people and programs to read.
It is built from objects in curly braces, arrays in square brackets, strings in double quotes, numbers, true, false and null.
The most common mistakes
Single quotes: JSON strings and keys must use double quotes.
Trailing commas: a comma after the last item in an object or array is not allowed.
Unquoted keys: every key must be a quoted string.
Comments: standard JSON has no comment syntax.
Special values: undefined, NaN and Infinity are not valid JSON values.
Format before you debug
Minified JSON on one line hides structure. Formatting it with indentation shows nesting clearly and makes missing brackets easy to spot.