How to Validate JSON
Valid JSON is text that JSON.parse accepts. Validation does not pretty-print or minify; it only reports whether the document is legal JSON.
The test
If JSON.parse(text) succeeds, the text is valid JSON. If it throws, it is not. A validator that only checks braces by eye will miss a trailing comma.
{
"name": "Ada",
"ok": true
}parses. This does not:
{
"name": "Ada",
}Steps
- Paste the document you intend to send or store — not a screenshot.
- Run Validate. On the MultiConvers JSON formatter, that leaves your spacing alone and only reports parse success or failure.
- If it fails, read the line and column, then look for a trailing comma, a missing quote, or a comment.
Common failures
| Input | Why it fails |
|---|---|
{"a": 1,} | Trailing comma |
{a: 1} | Unquoted key |
{'a': 1} | Single quotes |
After it parses, format or pretty-print if you need to read it.
FAQ
- Does valid JSON mean my schema is right?
No. Parse only checks JSON syntax. A missing field your API needs is still valid JSON.
- Why is the line number only approximate?
Engines often report a character offset. Converting that to a line and column depends on newline style. Use it as a starting point.
Related guides
How to Format JSON
Formatting JSON means parsing it, then reprinting the same value with consistent indentation. Invalid text cannot be formatted — fix the syntax first.
JSON Pretty Print
Pretty-print reprints valid JSON with indentation so a person can read it. Minify reprints the same value as one line. Neither changes what the document means.
Related tools
See all guides.