How to Validate JSON and Fix Syntax Errors Fast

Validate JSON online, understand line-and-column errors, and fix missing commas, quotes and brackets with practical examples.

Advertisement

A validator answers one question: is this text syntactically valid JSON? A good one also tells you where it breaks so you can fix it in seconds instead of scanning hundreds of lines by eye.

Validate in three steps

  1. Paste your text into the JSON validator.
  2. Read the status bar: green means valid, red means invalid with a line and column.
  3. Press Go to error, fix the character, and validate again.

Reading error messages

  • "Unexpected end of JSON input" — a value, comma or closing bracket is missing at the end. Count your { vs }.
  • "Expected property name" — an object key lost its quotes or a colon is missing.
  • "Unexpected token at line X, column Y" — look for a missing comma, an extra comma, or single quotes.
  • "Bad control character" — a raw newline sits inside a string; use \n instead.

A real fix, start to finish

{
  "name": "Ada",
  "tags": ["a" "b"],
}

This has two bugs: a missing comma between array items and a trailing comma. The fixed version:

{
  "name": "Ada",
  "tags": ["a", "b"]
}

Prevent errors next time

See all seven patterns with examples in Common JSON errors.

Advertisement

Try it in the tools

Related guides

Advertisement