Unexpected token < in JSON at position 0
You received HTML, not JSON — a 404 page, a 500 page, or a login redirect. No JSON document begins with an angle bracket. Log the response body before parsing it.
Full explanation →Unexpected token '<', "<!DOCTYPE "... is not valid JSON
The same error in newer Node and Chrome, reworded. The quoted preview shows you exactly what arrived — an HTML document.
Full explanation →Unexpected token o in JSON at position 1
You passed an object to JSON.parse. JavaScript converted it to the string [object Object] first. The value was already parsed — remove the extra parse call.
Full explanation →Unexpected end of JSON input
The document ended early: an empty response body, a truncated download, or an unclosed bracket. An empty string is not valid JSON, so a 204 No Content response triggers this too.
Full explanation →Expecting value: line 1 column 1 (char 0)
Python’s version of the same problem. Failing at char 0 means the input was empty, was HTML, or was a filename string passed to json.loads instead of file contents.
Full explanation →Extra data: line 2 column 1
Parsing succeeded, then found more content. Your file holds several JSON documents — usually NDJSON, one object per line. Parse it line by line rather than in one call.
Full explanation →Expecting property name enclosed in double quotes
A key is unquoted or single-quoted, or a trailing comma left the parser expecting another key. JSON requires double quotes on every key.
Full explanation →Invalid control character at
A literal newline or tab sits inside a string. Characters below U+0020 must be escaped as \n and \t.
Full explanation →JSON.parse: unexpected character at line 1 column 1 of the JSON data
Firefox’s wording for a response that was never JSON. Same diagnosis as “Unexpected token <”.
Full explanation →Unexpected token } in JSON
Almost always a trailing comma before the closing brace. JSON, unlike JavaScript and Python, forbids it.
Full explanation →Duplicate key
The specification permits duplicate keys but leaves the result undefined — most parsers keep the last one silently. Strict linters reject it. Deduplicate the source.
Full explanation →