JSON guides
Guides to how JSON works, and to fixing the errors you run into when you parse it. If you already have an error message, paste it into the error lookup. It works out which parser wrote it and sends you to the right guide.
Learn JSON
Fix errors
All JSON errors
Every common parse error, explained.
Unexpected token
Usually an HTML page instead of JSON.
Unexpected end of JSON input
Empty or cut-off responses.
Expecting property name
Single quotes and unquoted keys.
Trailing commas
Find and remove them safely.
[object Object] is not valid JSON
Parsing something already parsed.
Extra data
More than one JSON value.
Bad control character
Line breaks and tabs in strings.
Converting circular structure
Objects that point back to themselves.
By language
Python: Expecting value
JSONDecodeError at line 1 column 1.
Python: Expecting ',' delimiter
Missing commas and unescaped quotes.
Python: not JSON serializable
Dates, Decimal, sets, and NumPy values.
Go: invalid character
What each encoding/json error means.
Go: cannot unmarshal
When a value doesn’t fit your struct.
Rust: expected value
serde_json errors, from HTML responses to missing fields.
Java: Unrecognized field
Jackson and fields your class doesn’t have.
Java: Cannot deserialize value
When the JSON’s shape doesn’t match your type.
Java: Cannot construct instance
Constructors, records, Lombok, and interfaces.
C#: could not be converted
System.Text.Json and values that don’t fit.
PHP: json_decode returns null
Get the real error and fix it.