JSON Validator

Validate JSON and see the exact line and column of every error in plain English, fix common mistakes, and check data against a JSON Schema.

Is your JSON valid? Paste it here and find out instantly. When something is wrong, the validator shows the exact line and column and explains the problem in plain English — “Trailing comma before }” instead of a cryptic “Unexpected token”.

It can also repair the most common mistakes for you, warn about duplicate keys and check your data against a JSON Schema. Everything runs in your browser: your JSON is never uploaded.

How to use JSON Validator

  1. Paste your JSON into the box, drop a .json file onto it, or click “Open file”.
  2. Read the result: a green “Valid JSON”, or the error with its line and column (the error is highlighted in the text).
  3. If it is invalid, click “Try to fix” to preview an automatic repair, then “Use fixed JSON”.
  4. Optional: tick “Also validate against a JSON Schema” and paste your schema to check required fields, types and formats.

Features

  • Strict JSON check (RFC 8259), the same rules browsers and APIs use.
  • Plain-English error messages with line and column, and the position highlighted.
  • “Try to fix” repairs trailing commas, comments, single quotes, unquoted keys, Python True/False/None, NaN and more — with a preview first.
  • Warns about duplicate keys that most programs silently drop.
  • JSON Schema validation (draft 2020-12): types, required, enum, patterns, formats, min/max, arrays, $ref and more.
  • Schema errors listed by JSON path, for example $.tags[2].
  • Checks large files without freezing the page.
  • Private: runs in your browser, nothing is uploaded or stored.

What makes JSON invalid?

JSON looks like JavaScript but its rules are much stricter. Keys and text must use double quotes, there can be no comma after the last item, comments are not allowed, and only true, false and null (all lower case) are allowed as literals. A single misplaced character makes the whole document invalid, and most programs refuse to read it.

Message you will seeWhat it means
Trailing comma before }Remove the comma after the last property or item
Keys must be in double quotesWrite "name" instead of name or 'name'
Comments are not allowed in JSONRemove // and /* */ comments
Missing comma between two propertiesAdd a comma between "a": 1 and "b": 2
This string is never closedA closing double quote is missing
Brackets do not matchA [ was closed with } (or the other way round)
Unexpected … after the end of the JSON valueTwo values in a row: wrap them in [ ] or { }

What is JSON Schema?

JSON Schema is a standard way to describe what valid data looks like: which properties are required, what type each value has, allowed values, text patterns, number ranges and the shape of lists. APIs, configuration files and form builders use it to reject bad data before it causes problems.

Valid JSON only means the syntax is correct. A schema check goes further: {"age": "forty"} is valid JSON, but it fails a schema that says age must be an integer.

Supported JSON Schema keywords

The validator supports the keywords used in the vast majority of real-world schemas (draft 2020-12, also compatible with most draft-07 schemas). Unknown keywords are ignored, as the standard requires.

AreaKeywords
Types and valuestype, enum, const
Objectsrequired, properties, additionalProperties, patternProperties, minProperties, maxProperties
Arraysitems, prefixItems, minItems, maxItems, uniqueItems
TextminLength, maxLength, pattern, format (email, date, date-time, uri, uuid, ipv4)
Numbersminimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf
CombiningallOf, anyOf, oneOf, not, $ref to #/$defs or #/definitions

Validator, linter or formatter?

A JSON validator answers one question — is this valid? — and explains why not. A JSON lint tool is the same thing under another name. A JSON formatter re-indents valid JSON to make it readable. If your JSON is valid and you want it tidy, use the JSON Formatter; if a program rejects your JSON, start here.

Frequently asked questions

Is this JSON validator free?

Yes. It is free, needs no sign-up and has no limits.

Is my JSON sent to a server?

No. Validation runs in your web browser on your own device, so private data such as API keys and customer records never leaves your computer.

Why is my JSON invalid when it works in JavaScript?

JavaScript object literals allow things JSON does not: single quotes, unquoted keys, trailing commas, comments, undefined and NaN. The validator names the exact rule that was broken and where.

Can it fix my JSON automatically?

Often, yes. “Try to fix” repairs trailing commas, comments, single quotes, unquoted keys, missing commas, Python-style True/False/None, NaN/Infinity and leading zeros. You see the fixed JSON and the list of changes before you apply it. Missing brackets and broken structure need a human.

What is a duplicate key and is it an error?

It is the same key appearing twice in one object, like {"a": 1, "a": 2}. The JSON standard does not forbid it, but most programs keep only the last value, so it usually hides a bug. The validator reports it as a warning.

Which JSON Schema versions are supported?

Draft 2020-12 keywords, which also covers most draft-07 and draft-06 schemas. References are supported within the same schema (#/$defs/… and #/definitions/…); remote references are not fetched, for privacy.

How large a file can I validate?

Files of 10 MB and more work; anything over 1 MB is checked in the background so the page stays responsive.

Does it accept JSON with comments (JSONC) or JSON5?

No — those are different formats. The validator reports comments as errors, and “Try to fix” can remove them to turn JSONC or simple JSON5 into standard JSON.

Related tools