JSONBeeby Candorbees

JSON validator

JSON validator that points at the error and offers a fix.

Paste JSON and find out in a second whether it is valid. If it is not, you see the exact line and column, why it failed in plain words, and a repair for the usual suspects. Your JSON stays in your browser.

Or drop a JSON file here

Free · No sign-up · Your data stays in your browser

what you paste
{
  "name": "Asha",
  "orders": 3
  "city": "Pune"
}
what you get
Line 4, column 3: Expected "," or "}" after property value, got """
A comma is probably missing before this, or the line above ends
without its closing quote or bracket.
The reason a parser gives is usually where it noticed the problem, which is one token after the mistake. The hint says where to look.
I
What it reports

The first error, exactly where it is

A parser cannot continue past a syntax error, so it reports the first one. The aim is to make that one quick to find and fix.

  • Line and column. Underlined in the editor, with a link in the status line that jumps to it. Columns count characters the way your editor does.
  • The same answer in every browser. Browsers word JSON errors differently, and Safari gives no position at all. This validator reads the text itself, so the result does not depend on your browser.
  • Valid JSON, summarised. When it passes you see the size, how deep it nests, and how many keys and values it holds.
  • JSON Lines. One value per line is recognised and offered to the dashboard instead of failing.
II
The usual suspects

The seven mistakes behind most invalid JSON

These account for nearly every "invalid JSON" message. Each is explained in the editor in the words below.

  • Trailing comma. "Remove the last comma: JSON does not allow one before a closing bracket."
  • Single quotes. "JSON strings and names use double quotes ("), not single quotes."
  • Comments. "JSON does not allow comments."
  • Missing comma. "A comma is probably missing before this, or the line above ends without its closing quote or bracket."
  • Unquoted names. "Property names must be in double quotes."
  • NaN, Infinity, undefined. "JSON has no NaN, Infinity or undefined. Use null, or a number."
  • An unterminated string or bracket. "A string is missing its closing double quote", or "The text ends early: a bracket or brace was opened and never closed."
III
Fixing it

Repair the common ones in one click

Most invalid JSON is almost valid JSON: a config with comments, a JavaScript object, a Python dump. The editor says what it would change before it changes anything.

  • Listed first. "Removed comments (×3), first at line 2", for each kind of fix.
  • Undoable. Apply repair, look at the result, and Undo if it is not what you meant.
  • Only what it can name. If the text is still not valid after those fixes, the repair is not offered and the error is reported as it is.
  • Then see what is in it. Valid JSON opens as a dashboard with tables, charts and automatic insights. What that looks like for an API response.
?
Questions

JSON validator FAQ

How do I validate JSON?
Paste it into the box on this page and choose "Validate JSON". The editor opens with the result: "Valid JSON" with its size and shape, or the line and column of the first error and why it failed.
What does "Unexpected token" mean in JSON?
The parser met a character it did not expect. It is usually one token after the real mistake, such as a missing comma before the character it complains about. This validator names the likely cause in plain words and marks where to look.
Why is JSON with a trailing comma invalid?
The JSON standard does not allow a comma after the last item of an array or object, although JavaScript does. Remove the comma, or click Repair and it is removed for you.
Can I validate JSON with comments?
Standard JSON has no comments, so it is reported as invalid. The Repair button removes them, and also converts single quotes, quotes bare property names and drops trailing commas, so a JSON5 or JSONC file becomes valid JSON.
Is a file with one JSON value per line valid?
It is JSON Lines (also called NDJSON), not one JSON document. The validator recognises it and offers to open it as a table in the dashboard, where each line becomes a row.
Does it validate against a JSON Schema?
No. It checks that the text is valid JSON, not that it has the fields a schema asks for.
Is my JSON uploaded anywhere?
No. Validation runs in your browser, and large files are handled in a background thread so the page stays responsive. Nothing is sent to a server.
Is it free?
Yes. Validating, formatting and minifying JSON are free, with no account.

Know it is valid, then see what it says.