- Home
- Guides
JSON error messages, explained
One guide per error message: what Chrome, Firefox and Safari say, what usually causes it, how to find the spot and how to fix it, with a real example.
- Unexpected end of JSON inputThe text ended before the JSON did: an empty response body or a cut-off download.
- Unexpected token '<', "<!DOCTYPE "... is not valid JSONYour code asked for JSON and got an HTML page: a 404, a login page or the app's index.html.
- Unexpected token in JSONA character JSON doesn't allow: NaN, single quotes, comments, a trailing comma or a BOM.
- Expected property name or '}' in JSONProperty names need double quotes: Python dicts, JavaScript objects and trailing commas.
- Bad control character in string literal in JSONA raw line break or tab inside a string, where JSON needs \n and \t.
- Unexpected non-whitespace character after JSONMore text after the JSON: JSON Lines, two documents, an extra } or a semicolon.
Have JSON that won't parse?
Paste it into the JSON Formatter. It shows the line and column of the first error, underlines the spot and fixes common mistakes in one click. It runs in your browser, and we never upload, log or store what you paste.