JSON Validator: Check JSON Syntax and Find Errors
By TheToolsBank Editorial TeamLast updated:
How to validate JSON online
- Paste your JSON into the box, such as an API response or a config file.
- Select Validate JSON. The button stays disabled while the box is empty or holds only spaces.
- Read the result. Valid JSON means the whole text parses. Invalid JSON comes with the error message, a Near line X, column Y hint, the line with a
^under the problem and often a Tip. - Fix the problem and select Validate JSON again. Editing the text clears the old result, so you never read a stale one.
The validator only checks and never changes your text. To indent valid JSON for reading, use the JSON Formatter. To remove whitespace for a smaller payload, use the JSON Minifier.
What common JSON error messages mean
The tool reads your JSON itself to word these messages, so they are the same in every browser. These are the ones you will see most.
| Error message starts with | Example input | Usual cause |
|---|---|---|
| Unexpected '}' after a comma | {"a": 1, "b": 2,} | Comma after the last item in an object |
| Expected a double-quoted property name | {'name': 'Ada'} | Single quotes, curly quotes, or an unquoted key |
| Expected ',' or '}' after a property value | {"a": 1 "b": 2} | Missing comma, unclosed object, or an unescaped quote inside a string |
| Unexpected ']' after a comma | [1, 2, 3,] | Comma after the last item in an array |
| Unexpected word "undefined" | {"x": undefined} | undefined, NaN or True, which are not JSON values |
| Unexpected character '<' | The HTML of an error or login page | The response was a web page, not JSON |
| Unexpected character '{' after the end of the JSON value | {"a": 1} {"b": 2} | Extra text after the JSON, such as a second object or a comment |
| Invalid escape sequence \U | {"path": "C:\Users"} | A single backslash in a string |
| Unexpected end of JSON input | {"a": | The text was cut off |
How the line and column are found
The line and column show where the tool stopped, which is usually right at the mistake. For a trailing comma, the caret sits under the closing brace and the message says the comma is the problem. If an object ends with "age": 36, and the brace is on the next line, you get line 4, column 1 and Unexpected '}' after a comma.
Columns are counted in UTF-16 units, so an emoji earlier on the same line makes the column one higher than the characters you see. JSON nested more than 500 levels deep falls back to your browser's own error message, which may be worded differently.
Valid JSON that may still be wrong
Valid means the syntax is correct, not that the data is right. These all pass:
- Duplicate keys.
{"a": 1, "a": 2}is valid, and JavaScript keeps only the last value, 2. The tool adds a Duplicate key warning with the line number. - Windows paths with single backslashes.
"C:\temp\new"is valid because\tand\nmean a tab and a line break. Write"C:\\temp\\new"to keep the backslashes. - A lone value.
42,"hello", andnullare each valid JSON, even if your app expects an object. - Wrong types.
"age": "36"passes even if your API needs a number.
What this validator does not check
- No JSON Schema. It checks syntax, not required fields or types.
- No JSON5 or JSONC. Comments, single quotes, and trailing commas are errors.
- No automatic repair. You fix the error, then validate again.
- No formatting or copy button. Your text stays as you pasted it.
Common Mistakes to Avoid
Validating a server error page instead of the API response
Solution:
Pasting JSON Lines, with one object per line
Solution:
Copying JSON from a document or chat app that turned straight quotes into curly quotes
Solution:

