What does "JSON Parse error: Unexpected token <" often indicate?

Responsive Ad Header

Question

Grade: Education Subject: Support
What does "JSON Parse error: Unexpected token <" often indicate?
Asked by:
64 Viewed 64 Answers
Responsive Ad After Question

Answer (64)

Best Answer
(524)
This specific error, often seen in JavaScript environments, typically indicates that the JSON parser received a string that begins with '<'. This usually happens when an API endpoint, instead of returning valid JSON, returns an HTML document (e.g., an error page, a login page, or a full webpage). The parser attempts to parse the '' or '' tag as JSON and fails because '<' is not a valid starting character for a JSON string, number, boolean, null, object, or array according to the JSON specification.