Formatter Validator Minifier Escape / Unescape JSON ↔ String JSON ↔ YAML JSON → CSV NDJSON / JSON Lines JSON → Types JSON ↔ XML JSON Diff JSON Patch Canonicalize (RFC 8785) Schema Validator Schema Generator JSONPath Tester JWT Decoder JSON Errors Schemas More Tools
JSONTools / JSON errors / Unclosed object — unexpected end of JSON input
JSON error registry · Truncated document

Unclosed object — unexpected end of JSON input

The document ends before its closing brace. Caused by truncated downloads, a response cut off by a timeout, a log line that hit a size limit, or a file read with the wrong length.

The input

Fails to parse
{"a": 1
Parses correctly
{"a": 1}

Open this broken input in the formatter →

How to fix it

Verify you received the whole payload. Compare the byte count against Content-Length, and check for proxy or log truncation.

If the truncation point moves between runs, suspect the transport. If it is always the same byte offset, suspect a fixed-size buffer.

What each parser reports

Every message below was captured by running this exact input through the parser named. 20 of 21 parsers rejected it; 1 accepted it.

Parser Exact message
CPython json.loads
CPython 3.12.3
Expecting ',' delimiter: line 1 column 8 (char 7)
what this message means →
encoding/json Unmarshal
Go go1.22.2
unexpected end of JSON input
what this message means →
Gson
Java 21.0.12
java.io.EOFException: End of input at line 1 column 8 path $.a
what this message means →
Gson JsonParser (lenient off)
Java 21.0.12
java.io.EOFException: End of input at line 1 column 8 path $.a
what this message means →
hjson
Node.js 22.22.2
End of input while parsing an object (missing '}') at line 1,7 >>>"a": 1 ...
what this message means →
Jackson ObjectMapper
Java 21.0.12
Unexpected end-of-input: expected close marker for Object (start marker
what this message means →
JavaScriptCore JSON.parse
JavaScriptCore (Bun 1.4.1)
JSON Parse error: Expected '}'
what this message means →
json-bigint
Node.js 22.22.2
Expected ',' instead of ''
what this message means →
JSON5
Node.js 22.22.2
JSON5: invalid end of input at 1:8
what this message means →
JSON::PP
Perl 5.038002
, or } expected while parsing object/hash, at character offset 7 (before "(end of string)")
what this message means →
json_decode
PHP 8.3.6
Syntax error
Newtonsoft.Json JsonConvert
Newtonsoft.Json 13.0.3 on .NET 8.0.30
Unexpected end when deserializing object. Path 'a', line 1, position 7.
what this message means →
Newtonsoft.Json JsonTextReader
Newtonsoft.Json 13.0.3 on .NET 8.0.30
accepted — no error
orjson
CPython 3.12.3
unexpected end of data: line 1 column 8 (char 7)
what this message means →
Ruby JSON.parse
Ruby 3.2.3
unexpected token at '{"a": 1'
serde_json::from_str
Rust (serde_json 1.x)
EOF while parsing an object at line 1 column 7
what this message means →
SpiderMonkey JSON.parse
SpiderMonkey 115
JSON.parse: end of data after property value in object at line 1 column 8 of the JSON data
what this message means →
System.Text.Json Deserialize
.NET 8.0.30
'1' is an invalid end of a number. Expected a delimiter. Path: $ | LineNumber: 0 | BytePositionInLine: 7.
what this message means →
System.Text.Json JsonDocument
.NET 8.0.30
'1' is an invalid end of a number. Expected a delimiter. LineNumber: 0 | BytePositionInLine: 7.
what this message means →
ujson
CPython 3.12.3
Unexpected character in found when decoding object value
what this message means →
V8 JSON.parse
Node.js 22.22.2
Expected ',' or '}' after property value in JSON at position 7 (line 1 column 8)
what this message means →

What the specification says

The exact sections that govern this error. Descriptions are our paraphrase; follow the links for the normative text.

Body Section
IETF
An object is curly brackets around zero or more members. A name is a string, a single colon separates name from value, and a single comma separates a value from a following name.
Ecma International
Gives the object grammar and states that the syntax does not require name strings to be unique and assigns no significance to member ordering.

Other errors in this category

Unclosed array — unexpected end of JSON input

The array's closing bracket is missing, usually for the same transport or buffer reason as an unclosed object.…

Unterminated string in JSON

A string opens but never closes, so the parser consumes the rest of the document looking for the closing quote. A double quote ins…

← All JSON parser errors