99digest is in early access — tools are free while we grow.
Guide

How to Validate JSON and Find Errors

JSON is deliberately small and strict, which is why a parser can be unforgiving. A document is either valid or it is not, and the error message tells you where it gave up, not always where the mistake began.

What the validator shows

Paste your JSON into the JSON Validator. A valid document shows “Valid JSON”. An invalid one shows the line and column and the parser’s message. For {"a":1,} you get line 1, column 8, and “Expected double-quoted property name”: the parser reached the comma, expected another key and found a closing brace instead.

The usual suspects

  • Trailing comma after the last item in an object or array. Allowed in JavaScript, not in JSON.
  • Single quotes. JSON strings and keys must use double quotes.
  • Unquoted keys. {name: "Ann"} is JavaScript, not JSON.
  • Comments. JSON has none, so // and /* */ are errors.
  • Missing or extra brackets. Count the opening and closing braces and square brackets.
  • Special values. undefined, NaN and Infinity are not valid JSON; use null or a string.
  • Unescaped characters inside strings, such as a raw line break or a stray double quote. See the escaping guide.

Fixing it

  1. Go to the reported line and column, then look just before it: the real mistake is often on the previous line or character.
  2. Fix one error at a time and validate again, since a parser stops at the first problem.
  3. When it passes, format it with the JSON Formatter to check the structure reads as you intended.

Valid does not mean correct

A validator confirms syntax only. It cannot tell you whether the right fields are present, whether a number should be a string, or whether the data matches an API’s expectations. For that you need a schema or the receiving system’s own checks.

Frequently asked questions

Is a single value like “hello” or 42 valid JSON?

Yes. Modern JSON allows any value at the top level, not only an object or array.

Is the position always exact?

It is where the parser noticed the problem, which is usually right at or just after the mistake.

Try the JSON Validator Free, instant, and runs in your browser.