Unexpected end of JSON input
The text ends before the document does — cut by a buffer, a log line limit, or a copy that missed the last lines. Every parser reports the end of the text; the fix closes what was left open and says how many.
What each parser says
The sample below, unchanged, through three parsers. The message is the same break in three wordings; the line or position each names is where the parser gave up, not always where the break is.
- Node and Chrome (V8), measured when this page was built
Unexpected end of JSON input- Python 3.14 json.loads, measured 2026-09-06
Expecting value: line 6 column 1 (char 110)- jq 1.7, measured 2026-09-06
jq: parse error: Unfinished JSON term at EOF at line 6, column 0
The fix, measured
- Cut inside an array
{"a": [1, 2{"a": [1, 2]}- Cut after a comma
{"a": 1,{"a": 1}- The whole sample
{ "order_id": "ord_8f3aa19c4d", "status": "fulfilled", "items": [ {"sku": "BRD-OAK-002", "qty": 1},{ "order_id": "ord_8f3aa19c4d", "status": "fulfilled", "items": [ {"sku": "BRD-OAK-002", "qty": 1}]}Close 2 open containers — the open list and the open object closed in order; the item the cut removed is not invented.
Where the parser points
Every parser reports the end of the text, because nothing is wrong until there is no more of it. The fix closes each open container in order — the array, then the object — and names how many; the value the cut took is not invented, and the app marks the closed containers as closed for you.
The sample
What the first sample opens — a real file, not an illustration written for this page.
Questions
Where does a cut JSON come from?
A log line limit, a terminal buffer, a response read before it finished, a copy that stopped a screen early, or a model that hit its token limit. The text is right up to the cut.
Can the missing part be recovered?
No, and the page does not pretend to. It closes the containers that were open so the rest parses, marks them, and leaves the last value as it was cut.
What if the cut is inside a string?
Then V8 says “Unterminated string” instead. The fix closes the string at the cut and then the containers; the app marks where the text stopped.