Skip to main content
Waiting for JSON. Paste, upload or drop a file.

The formatted result appears here once the JSON is valid.

Runs in your browser. Your JSON is never uploaded.

Free tool by GoodAI

JSON Validator: Find and Fix Syntax Errors

Paste JSON to check it instantly. If it is invalid, the validator shows the line, column and reason of the first error, and one click moves the cursor there.

What makes JSON valid

Valid JSON follows a strict grammar. Objects use double-quoted keys, strings use double quotes, values are strings, numbers, true, false, null, arrays or objects, and items are separated by commas with no comma after the last one. Comments, single quotes, undefined and NaN are not part of JSON, even though JavaScript accepts some of them.

Common JSON errors and how to fix them

  • Trailing comma: remove the comma after the last item in an object or array.
  • Single quotes: replace 'text' with "text". JSON only allows double quotes.
  • Unquoted keys: write {"name": 1} instead of {name: 1}.
  • Comments: remove // and /* */ comments before validating.
  • Unescaped characters: a line break or tab inside a string must be written as \n or \t.
  • Missing comma or bracket: the reported position is usually right after the place where something is missing.

How to read the error message

The message names the unexpected character and what was expected instead, for example Unexpected "o", expected a value. The reported position is where the parser gave up, so look at the character just before it as well. Press the red status line to place the cursor at that position in the input.

Related JSON tools

Frequently asked questions

Is this JSON validator private?+

Yes. Validation runs in your browser and your JSON is not sent to any server.

Does it check against a JSON Schema?+

No. It checks syntax only, that is, whether the text is well-formed JSON. Schema validation is not included.

Why is my JavaScript object not valid JSON?+

JavaScript object literals allow unquoted keys, single quotes, trailing commas and comments. JSON does not. Quote every key with double quotes and remove the extras.

Looking for AI tools with demo videos?

Browse GoodAI