MultiConvers

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.

By Andreas Rosenberg

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

  1. Paste the document you intend to send or store — not a screenshot.
  2. Run Validate. On the MultiConvers JSON formatter, that leaves your spacing alone and only reports parse success or failure.
  3. If it fails, read the line and column, then look for a trailing comma, a missing quote, or a comment.

Common failures

Text that looks like JSON but is not
InputWhy 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

Related tools

See all guides.