</>
ValidateHTML

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

Invalid JSON
{
  "users": [
    {
      "name": "Alice",
      "age": 25
    },
    {
      "name": "Bob",
      "age": 30
  ]
}
Valid JSON
{
  "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 Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated JSON APIs on reliable hosting.

Get 80% Off Hosting →

Related JSON Errors

View all JSON errors