Common JSON errors
| Error | Example | Fix |
|---|---|---|
| Trailing comma | {"a":1,} | Remove the last comma |
| Single quotes | {'a':1} | Use double quotes |
| Unquoted keys | {a:1} | Quote every key |
| Comments | // note | JSON has no comments — remove them |
| Special values | NaN, undefined | Use null or a number |
The validator reports the parser's message, which usually includes the position of the problem.
Beautify vs minify
- Beautify (2 spaces, 4 spaces or tabs) — for reading, debugging and code reviews.
- Minify — removes all whitespace for smaller API payloads and config files.
JSON-LD for SEO
Structured data for search engines is written in JSON-LD. Format it here to check it is valid JSON before testing it in Google's Rich Results Test. Generate FAQ markup with the FAQ Schema Generator, or build a validation schema with the JSON to JSON Schema tool.
Your JSON is processed in your browser and never uploaded.
Frequently asked questions
How do I validate JSON?
Paste it into the formatter. If it is valid you get a formatted version; if not, you see the parser error and its position.
Why is my JSON invalid?
The most common causes are trailing commas, single quotes, unquoted keys and comments, none of which JSON allows.
What is minified JSON?
JSON with all unnecessary whitespace removed, which makes files and API responses smaller.
Is my data safe?
Yes. Formatting happens entirely in your browser.

