JJSONForge
Get JSONForge

JsonForge · JSON errors

Unexpected end of JSON input

The document stops before every bracket and brace is closed. Usually a truncated response body, an empty string, or a fetch that returned nothing.

An empty string produces exactly the same message, which is why this error so often means "the response was empty" rather than "the JSON is malformed". Check the HTTP status before blaming the parser.

The smallest input that causes it

{"items": [1, 2,

JSON.parse on that gives, verbatim:

Unexpected end of JSON input

The fix

{"items": [1, 2]}

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