Common JSON formatting errors and how to fix them
Learn the most common JSON formatting errors, including missing commas, wrong quotes, trailing commas and parse failures.
Most JSON errors start with small syntax mistakes
A missing comma between fields can make a valid looking object fail immediately. The same happens when quotes are mixed up or when a string is left open.
JSON also requires double quotes for keys and string values. Single quotes may work in JavaScript, but they are not valid JSON.
Trailing commas and parse errors are the last thing to check
A trailing comma after the last item is one of the most common reasons a parser rejects a payload. It is easy to miss during manual editing, especially in larger objects and arrays.
When a parser reports an error, check the line and column first, then scan for missing commas, broken quotes and extra commas before assuming the data is wrong.