JSON has strict syntax rules derived from JavaScript object notation. Keys must be double-quoted strings. Values must be one of: string, number, boolean (true/false), null, array, or object. No trailing commas, no comments, no undefined values, and no single quotes.
Common JSON Errors
Single-quoted strings — JSON requires double quotes for all strings
Trailing commas — no comma allowed after the last item in an array or object
undefined values — use null instead
Comments — JSON does not support any comment syntax
Frequently Asked Questions
The most subtle JSON errors are: (1) a trailing comma after the last property in an object or last element in an array, (2) a BOM (byte order mark) character at the start of the file (invisible in most editors), (3) using curly quotes (“”) copied from a word processor instead of straight quotes.
For minor issues like trailing commas or comments, try json5 or jsonc parsers. For larger issues, manually review the error position shown by this validator. The JSON Formatter tool will also show the error position when it fails to parse.
JSONP (JSON with Padding) wraps JSON in a function call like callback({...}) to bypass old browser cross-origin restrictions. It is not standard JSON and will fail JSON.parse(). Modern APIs use CORS instead of JSONP.