JSON Validator

Paste JSON to check it. A mistake is shown with its line, column and a plain explanation. Valid JSON also gets a check for duplicate keys and for numbers JavaScript would round.

How it works

The JSON is read by a strict parser that follows the JSON standard (RFC 8259). It stops at the first mistake and reports the line, the column and the likely cause, with the line shown and a caret under the spot.

The explanations cover the usual causes: a trailing comma, single quotes, comments, a missing comma, a key without quotes, Python's True, False and None, JavaScript's undefined and NaN, a leading zero, and JSON that ends before a bracket closes.

Valid JSON gets a summary: what the top level is, how many values it holds and how deeply they are nested. It also lists keys written twice in one object, and numbers that a browser or Node.js would read as a different value.

How to use it

  1. 1 Paste your JSON into the box, or type it.
  2. 2 Read the result under the box. It updates as you type.
  3. 3 If there is an error, go to the line and column shown and fix the spot marked with the caret.
  4. 4 If the JSON is valid, read any notes about duplicate keys or numbers that would change.

Good to know

  • Only the first error is shown, because after a mistake the parser cannot be sure what the rest means. Fix it, and the next one, if any, appears.
  • An error at the very end that says a bracket is never closed usually means a missing } or ] much earlier. The message names the line where the unclosed one opened.
  • If your file has comments or trailing commas on purpose, it is probably JSONC or JSON5, such as a VS Code settings file. Those are not JSON, and a strict reader will reject them.
  • To fix layout once the JSON is valid, paste it into the JSON Formatter.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Reading a JSON error, and the two problems a valid file can still hide

JSON is strict about a few things that JavaScript, Python and YAML are relaxed about, and nearly every invalid file breaks one of the same handful of rules. A comma after the last item is not allowed. Strings and keys need double quotes, not single quotes. Comments are not allowed at all. The literals are lowercase true, false and null, so Python's True and None fail, and JavaScript's undefined and NaN do not exist in JSON. Numbers cannot have a leading zero, a leading plus sign or a bare decimal point.

The browser's own JSON.parse finds these mistakes, but it reports them tersely, and every browser words it differently. A typical message names an unexpected token and a character position, which leaves you counting characters. This validator uses its own parser, which knows the usual causes. It tells you the line and column, shows that line with a caret under the spot, and says in a sentence what is wrong and how to fix it. For a trailing comma it says so; for a single quote it tells you to use double quotes; for an unclosed bracket it names the line where the bracket opened.

Passing the check does not mean every program will read the file the same way. The first hidden problem is duplicate keys. The standard says object keys should be unique but does not require it, so {"id": 1, "id": 2} is valid JSON. What it means depends on the reader. JavaScript and Python keep the last value. Some Go and Java libraries keep the first, and a strict reader rejects the file. A config file with a duplicate key can therefore behave differently in two services. The validator lists the path of every repeated key, such as $.users[3].email.

The second hidden problem is numbers. JSON allows a number of any length, but most programs read numbers into 64-bit floats, which hold about 16 significant digits. An ID such as 1234567890123456789 is valid JSON, yet a browser or a Node.js service reads it as 1234567890123456800, and the next request uses the wrong ID. The validator checks every number and lists those a JavaScript reader would change, with their paths. The usual fix is to send such IDs as strings.

The summary at the top is a quick sanity check too. It says whether the top level is an object or an array, how many keys or items it has, how many values there are in total, and how deep the nesting goes. If you expected an array of 500 records and it says an object with 3 keys, the data is wrapped differently from what you thought. All of this happens in your browser, and the JSON never leaves the page.

Frequently asked questions

Why is a trailing comma an error?

The JSON standard does not allow a comma after the last item of an object or array. JavaScript does, which is why it is such a common mistake. Delete the comma before the closing } or ].

My JSON is valid. Why does it warn about duplicate keys?

The standard says keys should be unique but does not forbid repeats, so the JSON is valid. Readers disagree about what a repeat means: JavaScript, Python and most others keep the last value, some keep the first, and some reject the file. The tool lists the paths so you can decide.

Why would a valid number change?

JavaScript numbers hold about 16 significant digits and values up to about 1.8e308. A number with more digits, or larger than that, is read as the nearest value JavaScript can store. A 64-bit ID such as 1234567890123456789 becomes 1234567890123456800. Send such IDs as strings.

Is the JSON I paste uploaded?

No. The check runs in this page. Nothing is sent to YappyKit or any other server.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.