59 chars · 4 lines
Two-way sync · Edit either side and the other updates automatically.
<!doctype html>59 chars · 4 lines
Two-way sync · Edit either side and the other updates automatically.
<!doctype html>API response troubleshooting
A JSON parser only sees the response body, not your expectation. A 404 page, authentication redirect, reverse-proxy error, framework exception page, or CDN challenge can all begin with HTML and trigger a parser error at the first < character. This tool is free to use. No account or payment is required.
Last updated
The HTML is often a useful error document. Its title or body can reveal whether the request hit a 404 route, login screen, application exception handler, load balancer, or CDN layer.
The correct fix is at the HTTP boundary. Removing angle brackets or feeding the HTML to a JSON repair tool would only hide the server-side cause.
The body is a 404 HTML document. The corrected example shows the kind of JSON payload the client expected after the route is fixed.
<!doctype html>
<html>
<body>404 Not Found</body>
</html>{
"error": "Not found"
}Common questions
HTML documents commonly begin with <, while < is not a valid first token for a JSON document.
Yes. Status and Content-Type are useful signals, but also inspect the raw body because misconfigured servers can send incorrect headers.
Yes. Authentication and routing redirects can lead the client to an HTML page even when the original URL was an API endpoint.
Debugging a specific JSON issue? Browse JSON troubleshooting.