Validate JSON and locate the error
Check whether text is valid JSON and see exactly where it breaks, with line, column and a caret.
0 / 2,000,000 characters · Updates as you type.
A missing comma at line 412 of a config file can cost half an hour if the only message you get is "Unexpected token". This validator parses the text with the same rules as JSON.parse and, when that fails, re-scans it with a small parser whose only job is to find the first offending character and explain it: a trailing comma, a single-quoted string, an unescaped line break, a bare word.
The message names the line and column (1-based, the way editors count) and prints the line with a caret underneath. Fix that one place and validate again; JSON errors are almost always sequential, so the next problem, if any, will be reported next.
When the document is valid the tool reports its top-level type and size, which is a quick way to check that an API returned an array rather than an object, or that a file is not empty.
How to use it
- Paste the text you want to check. Validation runs as you type.
- Read the result: either "Valid JSON" with the top-level type, or an error with line, column and a caret excerpt.
- Fix the reported character and check again until the document is valid.
- Switch to the JSON formatter (linked below) to pretty-print the valid result.
Frequently asked questions
What is the difference between this and the JSON formatter?
Both use the same parser and report the same errors. The validator stops there and tells you the type and size; the formatter also rewrites the document with your chosen indentation.
Does it validate against a JSON Schema?
No. It checks syntax only: whether the text is well-formed JSON. Schema validation (required fields, types) needs a schema document and is a different task.
Why does the position differ from my editor by one?
Both count from 1, but tabs are counted as one column here while some editors expand them to 4 or 8. Line numbers always match.
Can it find more than one error at a time?
It reports the first error only. Once a JSON parser hits an invalid character it cannot reliably resynchronise, so any further "errors" would be guesses.
Related tools
- Format, beautify or minify JSONPretty-print or minify JSON with 2-space, 4-space or tab indentation and optional key sorting.
- Convert JSON to CSVTurn a JSON array of objects into CSV for Excel or Google Sheets; nested objects become dot-separated columns.
- Decode a JWT (without sending it anywhere)Decode a JSON Web Token's header and payload and see whether it has expired. Signature is not verified; the token stays in your browser.
- Test a regular expressionTest a JavaScript regular expression against text with highlighted matches, capture groups and a timeout guard.