How to validate JSON
- Paste JSON, press Open file, or use From URL. It is checked as you type.
- Read the Report: what broke, the line and column, the lines around it and a fix.
- Press Go to error to jump there, or Repair JSON to fix common mistakes in one go.
- Once it passes, the report lists size, depth and counts of keys, strings, numbers and nulls. Validate (Ctrl + Enter) checks again.
Where the error really is
This config is missing a comma:
{
"name": "deploy-bot",
"retries": 3
"regions": ["eu-west-1", "us-east-1"]
}
The Report shows:
Invalid JSON
Line 3, column 15
Missing comma between properties.
1 {
2 "name": "deploy-bot",
3 "retries": 3
^
4 "regions": ["eu-west-1", "us-east-1"]
Fix: Add ',' after the value on the highlighted line.
JSON.parse in Chrome and Node.js reports the same text as SyntaxError: Expected ',' or '}' after property value in JSON at position 43 (line 4 column 3), one line late. The validator points at the end of line 3, where the comma belongs.
Strict syntax, plus two warnings
The rules are RFC 8259 with no extensions. Comments, trailing commas, single quotes, unquoted keys, NaN, Python’s True and None, leading zeros such as 02134, raw tabs or line breaks inside strings, and text after the last bracket are errors. When the problem is not a typo, the report names it: an HTML page, the text [object Object], curly quotes, a non-breaking space, or a byte order mark.
Two things are legal but cause bugs, so they are warnings:
- Duplicate keys. With
"status": "sent"followed by"status": "delivered", JavaScript and Python keep only the second. - Integers too large for JavaScript. Past 9,007,199,254,740,991, integers can lose digits:
JSON.parsereads1854123456789012345as1854123456789012200.
Syntax only
Valid JSON can still be the wrong data, such as a missing field or a string where your code expects a number. Check fields, types and ranges with the JSON Schema validator.
Errors the JSON validator explains
Why this happens in the report opens the error’s own page when there is one:
Unexpected end of JSON input: it counts the brackets left open and shows where the last one started.Unexpected token '<', "<!DOCTYPE "... is not valid JSON: flagged as an HTML page, with a reminder to check the URL, status code and Content-Type.Expected property name or '}' in JSON: a key without double quotes.Expected double-quoted property name in JSON: reported as a trailing comma, its usual cause.Unexpected non-whitespace character after JSON: extra text after the value, such as two pasted objects.Bad control character in string literal: a raw line break or tab inside a string.
The rest are in common JSON errors. JSON Repair fixes quotes, commas and comments in one pass.