Skip to content
CHARTOVANA

JSON Validator

Check whether JSON is valid and see exactly where it breaks, with the line, column and a plain-English explanation. Your JSON is checked in your browser and never changed or uploaded.
Runs in your browser. Nothing is uploaded.

Paste or type JSON above. It is checked as you type, entirely in your browser.

Need it tidied up too? Open the JSON Formatter.

How to use the JSON Validator

  1. Paste or type your JSON into the box. It is checked as you type.
  2. If it is invalid, read the line and column, the explanation and the marked excerpt, then use Show in input to jump to the problem.
  3. If it is valid, check the warnings for duplicate keys or numbers too large for JavaScript, which are legal but often cause bugs.

Examples

  • {"name": "Ada", "age": 36,} is invalid: line 1, column 26. Trailing commas are not allowed.
  • {'name': 'Ada'} is invalid: JSON needs double quotes around property names and text.
  • {"id": 12345678901234567890} is valid, with a warning: JavaScript would round that number, so large IDs are safer as strings.
  • {"a": 1, "a": 2} is valid, with a warning: most parsers keep only the last “a”.

What makes JSON valid

The validator follows the JSON standard (RFC 8259) strictly, the same rules APIs and most parsers enforce. The most common mistakes are:

  • a comma after the last item in an object or array;
  • single quotes instead of double quotes, or property names without quotes;
  • comments, which JSON doesn’t allow;
  • JavaScript values such as undefined, NaN or Infinity, and Python values such as True or None;
  • a missing comma, bracket or brace, or a line break inside a string.

Line and column

Lines and columns start at 1, as in code editors, so you can go straight to the problem. The error points at the first place the JSON stops making sense; sometimes the real mistake, such as a missing quote, is just before it.

Valid, with warnings

Some JSON is technically valid but still causes trouble. Duplicate keys are allowed, yet most parsers silently keep only the last value. Integers larger than 9,007,199,254,740,991 are allowed, yet JavaScript’s JSON.parse rounds them. The validator reads every number exactly as written, so it can point these out.

Validator or formatter?

This tool only checks your JSON and never changes it. To indent, minify or sort it, use the JSON Formatter, which uses the same parser.

Frequently asked questions

Is my JSON sent to a server?

No. It is checked entirely in your browser and never stored or uploaded, so it is safe for private data.

Does the validator change my JSON?

No. It only reads it. Your text stays exactly as you typed or pasted it.

Why is a trailing comma an error?

JavaScript allows a comma after the last item, but the JSON standard doesn’t, and many parsers reject it. Remove the comma before the closing bracket or brace.

Can it validate against a JSON Schema?

Not yet. It checks that the JSON is well formed, not that it matches a particular structure.

How large a file can it check?

Several megabytes work comfortably on a laptop. Checking runs in the background while you type, so the page stays responsive.

Last updated