What it checks
The validator answers one question: does this text parse as JSON? Paste it in, press Validate, and you get either a green “valid” message or the parser’s error. When the JSON is valid, the editor also shows it formatted with 2-space indentation.
This page uses the same editor as the JSON Formatter. The difference is only which button you press first.
How to use it
- Paste your JSON into the editor.
- Press Validate.
- If it fails, read the position in the error message and look a few characters before it. Fix it and validate again.
Where the error message comes from
The tool calls JSON.parse in your browser and shows whatever error it throws. It does not have its own parser or its own error explanations. In practice that means:
- Chrome and Firefox word the messages differently, so the same mistake can read differently in each.
- Most messages include a position, such as a character offset or a line and column. Use it to jump to the spot, then look a few characters before it. The parser reports where it gave up, which is sometimes just after the real mistake.
- It reports the first error only. After you fix one, run it again to find the next.
The mistakes that cause most failures
- A trailing comma after the last element of an array or object.
- Single quotes. JSON strings and keys use double quotes only.
- Unquoted keys.
{id: 1}is JavaScript, not JSON. - Comments. JSON has no comment syntax. Remove them or strip them before parsing.
- Unescaped characters inside strings, such as a raw line break or a lone backslash. Use
\nand\\. - Values that don’t exist in JSON:
undefined,NaN,Infinity.
Limits
Syntax only. A valid result means the text is well-formed, not that it has the fields your application expects. For that you need a schema check, and JSON to JSON Schema can generate a starting schema from a sample.
Does this validate against a JSON Schema?
No. It only checks syntax. Use a schema validator in your own stack for structure and types.
Why does it point to a different place than the real mistake?
The parser reports where it could no longer continue. A missing comma or quote usually shows up at the next token, so check the lines just before the reported position.
Does it show a tree view of the data?
No. It formats the valid JSON in the output box, but there is no collapsible tree.
Is the text sent to your server?
No. Validation runs in your browser.
Does it format valid JSON too?
Yes. When the text is valid, the output box shows it formatted with 2-space indentation.