JSON Error: Missing or Extra Bracket
SyntaxError: Unexpected end of JSON inputWhat Causes This Error?
"Unexpected end of JSON input" means the parser reached the end of the string before the JSON structure was complete. This is almost always caused by a missing closing } or ] bracket — the parser expected more content but the string ended. It can also be caused by a copy-paste that truncated the JSON, or by an extra closing bracket that confused the structure.
Common Causes
- arrow_rightForgetting to close an object { with a matching }
- arrow_rightForgetting to close an array [ with a matching ]
- arrow_rightCopy-pasting a JSON snippet that was cut off before the end
- arrow_rightMoving a block of JSON and leaving behind an orphaned opening bracket
- arrow_rightAdding a nested object and forgetting to close it before the parent closes
Example: Broken vs Fixed JSON
cancel Invalid JSON (causes the error)
{
"user": {
"name": "Alice",
"address": {
"city": "New York",
"zip": "10001"
}
}
"count": 1
}check_circle Fixed JSON (valid)
{
"user": {
"name": "Alice",
"address": {
"city": "New York",
"zip": "10001"
}
},
"count": 1
}Step-by-Step Fix Guide
Format to reveal the structure
Paste the JSON into the JSON Formatter. Even if it fails, the formatted output will visually show where indentation goes wrong — the deepest unclosed block is where the bracket is missing.
Count opening and closing brackets
Count every { — you need an equal number of }. Count every [ — you need an equal number of ]. A mismatch of 1 means exactly one bracket is missing or extra.
Check the end of the file
"Unexpected end of JSON input" specifically means the end of the string is wrong. Scroll to the very bottom and check whether all opened structures are properly closed.
Check for missing commas between siblings
The example above is also missing a comma between "user" and "count". Bracket errors often co-occur with missing comma errors — fix both.
Validate after each fix
If there are multiple bracket errors, the parser only reports the first. Fix one, validate, then fix the next.
Fix This Error Instantly
Paste your JSON into the validator to get the exact line number and error description. Then use the JSON Editor to make the fix and re-validate in one workflow.
Related JSON Errors
Part of the JSON Toolkit
Explore All JSON Tools
Free online tools for every JSON task — format, validate, convert, compare, and more.