JJSONForge
Get JSONForge

JsonForge · JSON errors

Unexpected token '<', "<html>" is not valid JSON

The body is HTML, not JSON. Almost always an error page, a login redirect, or a proxy response being parsed as if the request had succeeded.

The parser is telling you what the server actually sent. Log the raw body and the status code — the JSON is not the problem.

The smallest input that causes it

<html><body>502 Bad Gateway</body></html>

JSON.parse on that gives, verbatim:

Unexpected token '<', "<html><bod"... is not valid JSON

The fix

{"error": "bad gateway"}

That version parses.

Find it in your own document

Paste the JSON and get the error located by line and column, the document formatted, a schema inferred from it, and a diff against another version.

Open JsonForge

Other JSON errors