How the JSON Validator works

The validator reads your input with a strict parser that follows the JSON standard (RFC 8259). It checks every character in order, so the first problem is reported with its exact line and column, and the error location panel shows the offending line with a marker under the column. Comments, single quotes, trailing commas and unquoted property names are all reported as errors because standard JSON does not allow them.

When the syntax is valid, the validator walks the whole document. It compares the property names inside each object (after decoding escape sequences, so "a" and "\u0061" count as the same name) and lists every duplicate with its path, line and column, and where the name was first defined. Duplicate keys are legal syntax, but most parsers silently keep only the last value. It also counts objects, arrays, keys, strings, numbers, booleans and nulls, and measures the maximum nesting depth.

How to use the JSON Validator

  1. Paste your JSON into the input box, open a .json file, or select Load example.
  2. Select Validate JSON, or press Ctrl + Enter (Cmd + Enter on a Mac).
  3. If the JSON is invalid, read the message with the line, column and reason. The cursor jumps to the problem and the error location panel shows the line with a marker under the column.
  4. If the JSON is valid, review the structure summary and the duplicate keys table, which lists the path, line and column of every repeated property name.

Example

This input has a duplicate key:

{"id": 7, "name": "Ann", "id": 8}

The validator reports Valid JSON syntax, but 1 duplicate key was found. The duplicate keys table shows path $.id at line 1, column 26, first defined at line 1, column 2. The structure summary shows a top-level type of object, maximum depth 1, 1 object, 3 keys, 2 numbers and 1 string.

If a comma is missing, as in:

{
  "id": 7
  "name": "Ann"
}

the validator reports Invalid JSON at line 3, column 3: Expected ',' or '}' after property value but found '"'.

Common use cases

  • Checking an API request body or response before sending it or filing a bug report.
  • Finding the exact position of a missing comma, stray quote or trailing comma in a large configuration file.
  • Catching duplicate keys in hand-edited JSON, where most parsers silently keep only the last value.
  • Getting a quick overview of an unfamiliar document: its top-level type, how deeply it is nested and how many keys and values it contains.

Common errors and how to fix them

The reported line looks correct
The real mistake is usually earlier. An unclosed string or bracket is only detectable at the next structural character, so check the preceding lines for a missing quote, comma or closing brace.
The JSON is valid here but an API still rejects it
This tool checks syntax, not schema. A document can parse perfectly and still have the wrong field names, wrong value types or missing required fields for a particular API. Compare the payload against that API's documented schema.
Duplicate keys are listed but the result still says valid
RFC 8259 permits repeated property names, so they are reported as information rather than an error. Because most parsers keep only the last value, remove the duplicates if the earlier value is the one you need.
Numbers cannot have leading zeros
JSON does not allow values such as 007 or 0123. If the leading zeros are significant, for example a product or country code, quote the value so it becomes a string instead of a number.

Frequently asked questions

Which rules does the validator use?

It follows the JSON standard (RFC 8259). Comments, single-quoted strings, unquoted property names, trailing commas, leading zeros and values such as NaN or undefined are reported as errors. To repair that kind of relaxed JSON, use the JSON Beautifier.

Are duplicate keys an error?

The JSON standard does not forbid them, so the validator still reports the syntax as valid. Because most parsers keep only the last value for a repeated key, each duplicate is listed with its path, line and column and where the key was first defined, so you can decide whether to fix it.

How is the maximum depth counted?

The top-level object or array is depth 1, an object or array inside it is depth 2, and so on. A document that is a single string, number, boolean or null has depth 0.

Why does the validator stop at the first error?

After a syntax error the rest of the document cannot be read reliably, so any further messages would often be misleading. Fix the reported problem and validate again to find the next one.

Is my JSON uploaded to your server?

No. Validation runs in your browser with JavaScript, and the JSON you paste or open is not sent to our server.