Loading tool, please wait…
Modern browsers provide descriptive error messages when JSON.parse() fails. This reference table translates common error strings into clear root causes and solutions.
| Error Message | Typical Cause | Verified Solution |
|---|---|---|
| Unexpected token < in JSON at position 0 | Server returned HTML error page instead of JSON | Check API status code; inspect if response is HTML error |
| Unexpected token } in JSON at position X | Dangling trailing comma before closing brace | Remove trailing comma from the last property |
| Unexpected token ' in JSON at position X | Single quotes used instead of double quotes | Replace single quotes with double quotes around keys/values |
| Unexpected number in JSON at position X | Missing comma between object properties | Add comma separator between key-value pairs |
| Bad escaped character in JSON at position X | Invalid backslash escape (e.g. Windows path \U) | Double-escape backslashes as \\ |
| Unexpected end of JSON input | Empty string or truncated/incomplete response stream | Verify payload was received in full; check network buffer |
Check single-quote errors and identify unexpected tokens.
{
"error": 'unauthorized'
}