Handy Tool Online.

Blog

Common JSON Errors and How to Fix Them

By Handy Tool Online ·

Short answer: Most JSON errors come from a few mistakes: trailing commas, single quotes instead of double quotes, unquoted keys, comments, and unescaped characters inside strings. A formatter points to the exact line.

The usual suspects

JSON requires double quotes around keys and strings. It does not allow trailing commas, comments, single-quoted strings or values like undefined. Numbers cannot have leading zeros, and backslashes and quotes inside strings must be escaped.

Find the error fast

Paste the JSON into a formatter. If it is valid it will be indented neatly; if not, the error message usually names a line and position. Fix the first error and re-run, because one mistake often hides others.

Privacy tip

JSON often contains tokens or personal data. Use a formatter that runs in your browser so the payload is not sent to a server.

Try the tools

FAQ

Can JSON have comments?

No. Strict JSON does not support comments, though some tools accept a variant that does.