How to use the json validator
- Paste the JSON or drop a .json file into the input.
- Read the status: "Valid JSON" in green, or an error with line and column.
- Click the error to jump the cursor to the highlighted character.
- Look the message up in the table below to see the usual cause.
- Fix it by hand, or press Ctrl/Cmd+Alt+F to review a suggested repair, then validate again.
Features
- Strict RFC 8259 parsing: Rejects comments, trailing commas and single quotes, exactly as JSON.parse does.
- Exact position: Line and column of the failure, with the character highlighted.
- Readable reasons: "Expected a comma or }" instead of a raw engine message.
- Duplicate key hints: Valid JSON can still repeat a key; the later value wins in most parsers, so it is flagged.
Example
Invalid input → validator message
Input
{
"name": "Ada",
"age": 36,
}Output
Line 4, column 1: trailing comma before }. Remove the comma after 36.
Chrome reports the same input as "Unexpected token '}'", which points at the brace rather than the comma that caused it.
JSON error messages explained
| Error | Cause | Fix |
|---|---|---|
| Unexpected token } / ] | Trailing comma after the last item. | Delete the comma before the closing bracket. |
| Unexpected token ' | Strings or keys in single quotes. | Use double quotes: "key": "value". |
| Unexpected token / | A // or /* */ comment. | Remove comments; JSON has no comment syntax. |
| Unexpected token u / N / I | undefined, NaN or Infinity written as a value. | Use null, or a string if you need the word. |
| Unexpected end of JSON input | Missing closing } or ], often from a truncated copy, or an empty string. | Add the missing bracket or recopy the full payload. |
| Bad control character in string | A raw line break or tab inside a string. | Escape it as \n or \t. |
| Expected property name | Unquoted key such as {name: 1}. | Quote the key: {"name": 1}. |
| Unexpected token < at position 0 | An HTML page (often an error page) was returned instead of JSON. | Check the URL, status code and Content-Type of the response. |
Reading the line and column
The position points at the first character the parser could not accept, which is often one token after the real mistake. A missing comma between two properties is reported at the start of the second key; a trailing comma is reported at the closing bracket.
So when the highlighted character looks innocent, look one step to the left: the previous line's end, the previous value or the previous quote.
Syntax validation vs schema validation
This page checks syntax: can a standard parser read the text at all? It does not check meaning, such as whether "age" is a number or "email" is present. That is what JSON Schema is for, and schema validation is planned for a later release.
JSON Validator FAQ
How do I check if a JSON string is valid?
Paste it into the validator. If it parses under the JSON standard (RFC 8259) you see a valid status; otherwise you get the first error with its line and column.
Is JSON with comments valid?
No. Standard JSON has no comments. Formats such as JSONC and JSON5 allow them, but JSON.parse and most APIs reject them.
Are trailing commas allowed in JSON?
No. A comma after the last element of an object or array is a syntax error, even though JavaScript object literals accept it.
Why does the validator show only one error?
A JSON parser stops at the first syntax error because everything after it is ambiguous. Fix it and validate again to find the next one.
What does "Unexpected token < in JSON at position 0" mean?
Your code tried to parse an HTML document as JSON. The server returned a web page, usually a 404, 500 or login page, instead of the expected JSON. Inspect the raw response body.
Does valid JSON mean my data is correct?
No. Validation checks syntax only. Whether required fields exist or have the right types is a job for JSON Schema.
Is a bare string or number valid JSON?
Yes. Since RFC 7159, any JSON value is a valid document, so "hello", 42 and null all validate. Some older APIs still expect an object or array at the top level.
Related tools
- JSON fixer – fix these errors automatically – review each repair before applying.
- Fix LLM JSON – validate ChatGPT replies – handles fences and cut-off output.
- JSON formatter – validate and pretty-print – validate and pretty-print together.

