Unclosed Bracket or Brace in JSON
Every opening brace { must have a matching closing brace }, and every opening bracket [ must have a matching closing bracket ]. An unclosed bracket usually means you forgot to close a nested object or array, or you accidentally deleted a closing character.
Why It Matters
The parser reaches the end of the document expecting more content. The error message usually says 'unexpected end of input' which can be confusing because the actual problem is a missing bracket somewhere earlier in the document.
Code Examples
{
"users": [
{
"name": "Alice",
"age": 25
},
{
"name": "Bob",
"age": 30
]
}{
"users": [
{
"name": "Alice",
"age": 25
},
{
"name": "Bob",
"age": 30
}
]
}How to Fix
- 1Use an editor with bracket matching to find unmatched brackets and braces.
- 2Indent your JSON properly. Mismatched brackets become obvious with correct indentation.
- 3Count opening and closing brackets. The numbers must match for both {} and [].
- 4Start from the error position and work backwards to find the unclosed structure.
Check Your JSON Now
Our JSON validator detects this error automatically and shows the exact line and column.
Open JSON ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated JSON APIs on reliable hosting.
Related JSON Errors
Unexpected Token in JSON
Learn why JSON throws an unexpected token error and how to fix it. Common causes include trailing commas, single quotes, and unquoted keys.
Missing Comma Between Properties
Learn how to fix the missing comma error in JSON. Every property pair must be separated by a comma.
Invalid Nesting in JSON
Learn how to fix improperly nested objects and arrays in JSON documents.