Output will appear here
Output will appear here
Paste JSON and the status bar says Valid JSON or Invalid JSON, followed by the parser's own error. In Chrome, Edge and other Chromium browsers that message includes the line and column. It checks strict JSON (RFC 8259): no trailing commas, comments, single quotes or NaN. Valid input is shown formatted, with a key count, nesting depth and size.
By Ankit Aglawe · Updated · Runs entirely in your browser
This passes, but read the output. event_id is above 2^53 and is rounded. "retry" appears twice and only the last value survives. \t inside a string is a tab escape, which is why Windows paths need doubled backslashes. Writing "C:\Users" with one backslash fails with "Bad escaped character".
{
"event_id": 18446744073709551615,
"path": "C:\\logs\\new",
"note": "tab\there",
"retry": 3,
"retry": 5
}{
"event_id": 18446744073709552000,
"path": "C:\\logs\\new",
"note": "tab\there",
"retry": 5
}The broken version had a comma after the tls object, just before the final }. Chrome reports that as Expected double-quoted property name in JSON at position N (line 6 column 1): after a comma the parser wants another key, and found } instead. Deleting the comma makes it valid.
{
"service": "checkout",
"port": 8080,
"retries": [100, 250, 1000],
"tls": { "enabled": true, "cert": "/etc/ssl/checkout.pem" }
}{
"service": "checkout",
"port": 8080,
"retries": [
100,
250,
1000
],
"tls": {
"enabled": true,
"cert": "/etc/ssl/checkout.pem"
}
}In an object the message is "Expected double-quoted property name", because a comma promises another key. In an array, [1,2,] gives "Unexpected token ']'". The object message gives the line and column of the character after the comma; the array message quotes the input instead of giving a position.
Two properties on separate lines with no comma between them give "Expected ',' or '}' after property value". The line and column point at the start of the second key, so the missing comma is at the end of the line above.
// and /* */ comments, 'single quoted' strings and unquoted keys like {a: 1} are JavaScript or JSON5, not JSON. They fail with "Expected property name or '}'" or "Unexpected token". The validator reports them; it does not rewrite your input.
JSON has no NaN, Infinity or undefined, and Python's True and None are not true and null. Each fails with "Unexpected token" naming the first letter. Also rejected: +1, .5, 01 and hex like 0x1F.
A literal line break or tab inside a string gives "Bad control character in string literal". Write them as \n and \t. Smart quotes pasted from a document (“a”) also fail, since only the plain " delimits strings.
A UTF-8 byte order mark at the start fails as an unexpected token. Two documents in a row, like {"a":1}{"b":2}, or JSON Lines pasted whole, fail with "Unexpected non-whitespace character after JSON". Validate JSONL one line at a time.
Duplicate keys and numbers too large for a double are valid syntax, so they pass silently (see the first example). The validator also does not check a JSON Schema: it answers "is this JSON?", not "does it have the right fields?".
| Message (Chrome / Node) | Usual cause | Fix |
|---|---|---|
Expected double-quoted property name | Trailing comma before } | Delete the last comma |
Expected ',' or '}' after property value | Missing comma, or an unescaped " inside a string | Add the comma or escape as \" |
Expected property name or '}' | Single-quoted or unquoted key | Use "key" |
Unexpected token 'N' | NaN (or I for Infinity, u for undefined) | Use null or a string |
Bad control character in string literal | Raw newline or tab in a string | Escape as \n / \t |
Bad escaped character | Backslash before a letter like \U | Double the backslash |
Unterminated string | Missing closing quote | Close the string |
Unexpected end of JSON input | Truncated input or empty paste | Paste the whole document |
Unexpected non-whitespace character after JSON | Extra text or a second document | Wrap in an array or split |
Enter the JSON you want to check in the editor. The validator accepts any text and will tell you whether it is valid JSON.
Valid JSON is highlighted in green with a confirmation message. Invalid JSON shows the exact error location with line number, column, and a description of the issue.
Edit your JSON directly in the editor based on the error feedback. The validator re-checks automatically as you type, showing real-time validation status.
Paste it in. The status bar under the editor turns green with Valid JSON, or shows Invalid JSON with the parser message. The formatted output only appears when the input parses.
The message comes from your browser's JSON parser. Chromium browsers add the line and column next to the character position; Firefox and Safari word their messages differently. The position counts characters from 0.
No, it only reports the error. The code generator pages (JSON to TypeScript and so on) do try a quick repair before converting: they strip comments and trailing commas, turn single quotes into double quotes, and quote bare keys.
Not as JSON. Comments are allowed in JSONC (used by VS Code and tsconfig.json) and JSON5, but JSON.parse and almost every API reject them.
No. It checks syntax only. To get a schema you can validate against, generate one with the JSON Schema tool and run it through a validator such as Ajv.
They run the same parser. This page is about why input fails and what each error means; the formatter page is about making valid JSON readable.
Need several formats at once? Convert All shows every output from one paste. Or browse all JSON converters.