JSON Guide

How to fix invalid JSON

Recognize common syntax errors and repair JSON without losing data.

Start at the first error

A parser often reports one error at a time. Fix the earliest reported location first because one missing quote or bracket can make every later line appear invalid.

Use the line and column as a starting point, then inspect the preceding token as well as the highlighted character.

Common mistakes

The most frequent problems are single-quoted strings, unquoted property names, trailing commas, JavaScript comments, and mismatched braces or brackets.

Never repair production data blindly. Preview the proposed document and validate it again before replacing the source.

Continue learning