This error almost always means your code expected JSON but received an HTML page instead — a 404 error page, a login redirect, a 500 server error, or a proxy response. The < is the first character of the HTML <!DOCTYPE> or <html> tag. JSONBlitz can extract any JSON that may be embedded in the response — paste the full HTML below and it will find it.
Formatted output appears here...
Process JSON to generate code...
"Unexpected token < in JSON at position 0" is the most searched JSON error. It means JSON.parse() or response.json() received an HTML document instead of JSON. The "<" character is position 0 of <!DOCTYPE html> or <html>. This is not a JSON formatting problem — the server returned the wrong content type entirely.
A 404 Not Found page returned when the API endpoint URL is wrong. A 401 or 403 page when authentication is missing or expired. A 500 Internal Server Error page when the backend crashed. A login redirect page when a session expired. A CDN or proxy returning a cached HTML error. In each case the server is telling you something went wrong — it just did it in HTML rather than JSON.
Open your browser DevTools Network tab, find the API request, and look at the Response tab. If you see HTML there, the problem is the server response — not your JSON parsing code. Check the HTTP status code: 200 with HTML content means your endpoint URL may be wrong or your routing is broken. 4xx or 5xx status codes tell you the specific error type.
If the HTML response contains embedded JSON — in a script tag, a data attribute, a comment, or inline — JSONBlitz will extract it. Paste the full response below. If the HTML contains no JSON, JSONBlitz will tell you clearly so you know the problem is upstream in your API.