JSON Validator.

Check whether your JSON is valid and pinpoint syntax errors by exact line and column. Fast, free, and 100% private — it runs in your browser.

No signup · No uploads · Free forever

Result

// Paste JSON and press “Validate JSON”.

Validate JSON online — find errors instantly

A JSON validator tells you whether a document is well-formed JSON and, when it is not, exactly where it breaks. Paste your JSON above and press Validate JSON: the tool parses it locally and reports either “Valid JSON” with key, array, and depth counts, or the precise line and column of the first syntax error.

Common JSON errors this catches

  • Trailing commas after the last item in an object or array.
  • Single quotes or unquoted keys — JSON requires double quotes.
  • Mismatched brackets and [ ].
  • Comments, which standard JSON does not permit.
  • Smart quotes and stray characters pasted from documents.

What the error messages actually mean

JSON parser errors are terse and unhelpful until you know the pattern behind each one. These four cover almost everything you will hit:

Unexpected token } in JSON at position 42 — a trailing comma. JavaScript happily accepts { "a": 1, }; JSON forbids it, so the parser reaches the } while still expecting another key.

Expecting property name enclosed in double quotesunquoted keys or single quotes. Your text is a Python dict or a JavaScript object literal, not JSON. Every key and every string value needs double quotes.

Unexpected end of JSON input — the document is truncated, leaving braces unclosed. Usually a partial download, or an LLM that hit its token limit.

Unexpected token N / T in JSON — Python's None, True, or NaN. JSON knows only null, true, and false, all lowercase.

“But my JSON looks fine!” — the invisible causes

When the error position points at something that looks perfectly correct, the culprit is nearly always something you cannot see:

  • Smart quotes. Text pasted from Word, Notion, or a chat window arrives with “curly” quotes instead of "straight" ones. They look almost identical and are not valid JSON.
  • A BOM. An invisible byte-order mark at the very start of the file, courtesy of Windows Notepad or an Excel export.
  • Comments. Strict JSON has no comment syntax — not //, not /* */. Config files that look like JSON are often JSON5 or JSONC, which do allow them.
  • A real tab or newline inside a string. These must be escaped as \t and \n, not embedded literally.

All four are fixed automatically by the JSON repair tool — send your input there rather than hunting for an invisible character by eye.

Syntax validation vs schema validation

These are two different jobs and people conflate them constantly. This page does syntax validation: is this parseable JSON at all?

It cannot tell you whether { "age": "twenty" } is wrong — that is perfectly valid JSON syntax, just the wrong type for your data. Checking that age must be a number, that email is required, or that status must be one of three values is schema validation. For that, build a contract with the JSON Schema generator.

Do them in order: valid syntax first, correct structure second.

Validate privately, then keep working

Validation runs entirely client-side, so it is safe for sensitive data. Once your JSON checks out, format it for readability, minify it for production, or explore it as a tree. New to the format? Read common JSON errors and how to fix them.

Validating each file first also makes a merge predictable: if you plan to combine several JSON files into one, a single malformed input is the usual reason the whole operation fails, and it is far easier to find the bad line here than in the combined output.

FAQ

JSON validation, answered.

How do I validate JSON online? +

Paste your JSON into the validator above and press Validate JSON. The tool parses it in your browser and tells you immediately whether it is valid. If it is not, you get the exact line and column of the first syntax error so you can fix it fast.

What makes JSON invalid? +

The most common causes are trailing commas, missing or mismatched brackets and braces, single quotes instead of double quotes, unquoted keys, and comments (which standard JSON does not allow). The validator points to the precise location of the first problem it finds.

Does the validator check against a JSON Schema? +

This tool checks JSON syntax — whether the document is well-formed and parseable. It does not yet validate against a JSON Schema (type and shape rules). For structural checks, format the JSON and inspect it with the JSON viewer.

Is my JSON sent anywhere when I validate it? +

No. Validation happens entirely in your browser. Your JSON never leaves your device, so it is safe to validate configuration, tokens, or private API responses.

Why does my JSON say invalid when it looks fine? +

Look closely at the reported line and column. Common hidden culprits are a trailing comma after the last array or object item, smart/curly quotes pasted from a document, or a stray non-printing character. The error message and position pinpoint exactly where parsing failed.

What is the difference between a JSON validator and a JSON schema validator? +

A JSON validator checks syntax — is this parseable JSON at all? A JSON Schema validator checks structure and content — does this JSON have the required fields, of the right types, within the allowed ranges? Syntax first, then schema. This page does the syntax check; use the JSON Schema generator to build a contract for the second kind of validation.

What does 'Unexpected token } in JSON at position 42' mean? +

You almost certainly have a trailing comma before a closing brace or bracket. JavaScript allows { "a": 1, } but JSON forbids it, so the parser hits the } where it expected another key. The reported position is the character offset — the validator maps it to a line and column for you.

Can JSON have comments? +

No. Strict JSON has no comment syntax at all — neither // nor /* */. This surprises people constantly because config files often look like JSON while actually being JSON5 or JSONC, which do allow comments. If your file has comments and a parser rejects it, strip them with the JSON repair tool.

Are duplicate keys valid JSON? +

Technically the specification permits them, but the behaviour is undefined and every parser resolves them differently — most keep the last one, silently discarding the first. Treat duplicate keys as a bug: they are a common source of data that mysteriously disappears.