JSON Error Fixes — Parse Errors & Common Mistakes
Diagnose and fix the most common JSON parse errors and mistakes.
Expecting Property Name Enclosed in Double Quotes: Cause & Fix
Fix the classic JSONDecodeError: Expecting property name enclosed in double quotes in Python and JavaScript. Learn why single quotes and unquoted keys break JSON and how to fix them.
Unexpected Non-Whitespace Character After JSON Data: Causes & Fix
Fix 'Unexpected non-whitespace character after JSON' in JSON.parse(). Covers concatenated JSON objects, NDJSON streaming data, trailing garbage bytes, and how to parse each correctly.
Bad Control Character in String Literal in JSON: Cause & Fix
This JSON.parse error means a raw newline, tab, or control character is sitting inside a string. Why it happens, how to escape it correctly, and how to stop it at the source.
CORS Error Fetching JSON from an API — Cause & Fix
Blocked by CORS policy when fetching JSON with fetch() or axios? Here's exactly why, which headers fix it, and how to configure your server.
Converting Circular Structure to JSON — Cause & Fix
TypeError: Converting circular structure to JSON happens when an object references itself. Here's exactly why, and 3 ways to fix it, with code.
Unexpected End of JSON Input — Causes and Fixes
Fix 'Unexpected end of JSON input' in JavaScript. Covers empty responses, truncated API bodies, unfinished JSON strings, and encoding issues with examples.
Unexpected Token in JSON at Position 0 — Causes & Fix
Usually means your fetch got HTML or an empty response instead of JSON. Check the 4 common causes — and the exact fix for each, with code examples.