Errors · JSON

# 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.

no signup · runs entirely in your browser · ⌘V works anywhere on this page

## 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.

Expecting value: line 6 column 1 (char 110)

jq: parse error: Unfinished JSON term at EOF at line 6, column 0

## The fix, measured

{ "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.

```
{
  "order_id": "ord_8f3aa19c4d",
  "status": "fulfilled",
  "items": [
    {"sku": "BRD-OAK-002", "qty": 1},
```

## 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.

## Behind this page

## Try it on the file that broke your afternoon.

free while in alpha · no signup

---

Canonical: https://unstringify.com/errors/unexpected-end-of-json-input
