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
- Paste your text into the JSON validator.
- Read the status bar: green means valid, red means invalid with a line and column.
- 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
\ninstead.
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
- Format after every edit with the JSON formatter — misalignment reveals bracket mistakes.
- Sort keys with the JSON sorter before diffing configs with the JSON diff.
- Never hand-edit minified JSON; beautify it first with the JSON beautifier.
See all seven patterns with examples in Common JSON errors.
Advertisement