JSON

JSON Validator

Checks a document against the JSON grammar and reports exactly where parsing fails.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the document you want checked.
  2. Select Validate.
  3. If it fails, read the reported line, column and surrounding text, then look one or two characters earlier for the real cause.

What json validator does

JSON is a strict format, and most of what people paste into it is very nearly JSON rather than actually JSON. Trailing commas, single quotes around strings, unquoted keys, comments and JavaScript literals such as NaN or undefined are all rejected by a conforming parser even though they read perfectly well to a human.

This validator reports the first failure with its line and column, plus the surrounding text, because the position a parser stops at is usually one or two characters after the real mistake. A missing closing brace, for example, is normally reported at the end of the document rather than where the brace should have been.

Frequently asked questions

Trailing commas, single-quoted strings, unquoted object keys, comments, and the JavaScript literals NaN, Infinity and undefined are all invalid, along with unterminated strings and unbalanced brackets. JSON is stricter than the JavaScript object syntax it resembles.

That usually means a bracket or brace was never closed. The parser reads to the end of the document before it can be certain, so it reports the end position. Look for the opening bracket that has no partner rather than at the reported line.

No. This checks syntax only — whether the document is well-formed JSON. Checking that it matches a contract is a separate job. Use the JSON Schema generator to draft a schema from a sample document.