Common JSON errors
Diagnose and fix parser failures, lint warnings, and gotchas.
Tools
Guides
The mistakes that cause 90% of parse failures.
Why they don't exist and what to do instead.
Why every parser rejects them.
Causes, positions, and fixes for this common error.
Five root causes — empty string, BOM, HTML response, undefined.
What parsers do and how to find and remove duplicates.
HTML returned instead of JSON — how to detect and fix it.
Truncated JSON — the four root causes and fixes.
json.loads() error causes and fixes with code examples.
Four patterns for serializing circular data safely.
Why it happens and how to handle non-serializable values.
Single quotes, empty strings, NUL bytes, and double-encoded JSON — with fixes.
The Python/requests error that means the body wasn't JSON.
The Python JSONDecodeError from single quotes, trailing commas, or a dict — fixes for each.