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
JSON error registry

JSON parser error messages

Every parser words the same mistake differently. This registry maps 379 distinct error messages, captured by running 50 malformed documents through 21 parsers, back to the 50 underlying causes — with the fix for each. Nothing here is transcribed from documentation: every message was produced by executing the parser.

Search the exact message

Syntax

/* */ comments are not valid JSON

Block comments, like line comments, have no place in the JSON grammar.…

// comments are not valid JSON

JSON has no comment syntax. Comments are ubiquitous in config files, and several tools (VS Code settings, tsconfig) accept them via the JSONC dialect,…

Colon inside a JSON array

Object syntax used inside array brackets — the brackets should be braces, or the colon should be a comma.…

Comma in an empty JSON object

A comma with no members around it, usually left after deleting the last entry of an object.…

Double comma in a JSON array

Two commas in a row, leaving an empty slot. JavaScript allows array holes; JSON does not.…

JavaScript object literal passed off as JSON

Unquoted keys, single-quoted strings and trailing commas together — valid JavaScript source, not a JSON document.…

Missing colon after an object key

A key followed directly by its value with no colon separating them.…

Missing comma between array elements

Two values in an array with only whitespace between them.…

Missing comma between object members

Two key/value pairs with no separator. Common after copy-pasting a block of members or deleting a member and taking its neighbour's comma with it.…

Numeric object key in JSON

A key written as a bare number. JSON object keys are always strings, even when they look like integers.…

Python dict repr passed off as JSON

The output of `str(dict)` or `print(dict)` rather than `json.dumps(dict)`. It combines single quotes with, potentially, `True`/`False`/`None` — severa…

Single-quoted strings in JSON

JSON only recognises double quotes. Single quotes are valid in JavaScript, Python and YAML, so pasted snippets from those languages fail immediately.…

Trailing comma in a JSON array

A comma after the last element of an array. Usually produced by a loop that appends `item + ','` without special-casing the final iteration.…

Trailing comma in a JSON object

A comma after the last member of an object. JavaScript, Python and most modern languages allow this in their own literal syntax, so it is very easy to…

Unquoted object key in JSON

Object keys must be double-quoted strings. A bare identifier is legal in a JavaScript object literal but not in JSON.…

Unquoted string value in JSON

A value that is neither a number, `true`, `false`, `null`, an object nor an array must be a quoted string.…

Invalid literal

Infinity is not valid JSON

Same root cause as NaN — a float overflowed and the serialiser wrote `Infinity` or `-Infinity`, which the JSON grammar has no token for.…

NaN is not valid JSON

`NaN` has no representation in JSON. It appears when a language serialises a floating-point not-a-number without checking — Python's `json.dumps` emit…

Python True / False / None in JSON

Python's `repr` of a dict writes `True`, `False` and `None`. JSON requires the lowercase `true`, `false` and `null`.…

undefined is not valid JSON

`undefined` is a JavaScript value with no JSON equivalent. `JSON.stringify` normally drops undefined object properties, so seeing it in a document mea…

String content

Invalid escape sequence in a JSON string

A backslash followed by a character JSON does not define. The complete set is `\" \\ \/ \b \f \n \r \t` and `\uXXXX`. Windows paths are the usual culp…

Literal newline inside a JSON string

A real line break between the quotes. JSON forbids unescaped control characters (U+0000 to U+001F) inside strings, and a newline is one of them.…

Literal tab inside a JSON string

A raw tab character inside string content. Like a newline, it is a control character and must be escaped.…

Lone surrogate in a JSON string

A high surrogate (`\uD800`–`\uDBFF`) with no following low surrogate. Characters outside the Basic Multilingual Plane — emoji, most notably — are enco…

Malformed \u escape in a JSON string

A `\u` not followed by exactly four hexadecimal digits.…

Raw NUL byte inside a JSON string

A U+0000 byte in string content, usually from a C string boundary, a fixed-width database column, or binary data that was treated as text.…

Truncated \u escape in a JSON string

A `\u` escape with fewer than four hex digits, typically where a string was cut mid-escape by a length limit.…

Number format

Bare minus sign where a number was expected

A minus with no digits after it. Typically a templated value that resolved to empty, leaving the sign behind.…

Hexadecimal number in JSON

JSON numbers are decimal only. `0x1F` comes from a language literal or from a value that should have stayed a string, such as a colour code or a memor…

Leading decimal point in a JSON number

`.5` is valid in several languages but JSON requires a digit before the decimal point.…

Leading plus sign in a JSON number

JSON allows a leading minus but not a leading plus. Explicitly signed values from spreadsheets or telemetry formats trip this.…

Leading zero in a JSON number

JSON's number grammar forbids a leading zero on a multi-digit integer, to avoid any suggestion of octal. Zip codes, phone numbers and zero-padded IDs …

Trailing decimal point in a JSON number

`1.` is valid in C and JavaScript but not in JSON, which requires at least one digit after the decimal point.…

Truncated document

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

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 fil…

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 inside string content t…

Wrong input entirely

Bare unquoted word as a JSON document

A single token with no quotes. Either a plain-text response being parsed as JSON, or a string value that was never quoted.…

Empty string passed to a JSON parser

The document is zero bytes. Almost always an upstream failure: an HTTP call that returned 204, a file that was never written, a variable that was neve…

Extra data after a JSON document

Two complete documents concatenated. Usually a file appended to rather than overwritten, or several API responses written to the same buffer.…

HTML received where JSON was expected

The response body is an HTML page, not JSON. The server returned an error page, a login redirect, a proxy or captive-portal interstitial, or a rate-li…

NDJSON fed to a whole-document JSON parser

Newline-delimited JSON: one complete document per line. Each line is valid on its own, but the file as a whole is not a single JSON text. Log pipeline…

The literal string 'undefined' as a JSON document

A JavaScript variable holding `undefined` was interpolated into a string and sent as the body. `String(undefined)` is `"undefined"`.…

Trailing characters after a JSON document

Non-whitespace content after the closing brace — a stray word, a shell prompt captured with the output, or a log line appended to the payload.…

Whitespace-only input

The document contains only spaces, tabs or newlines. Same family as empty input — a file was created but never filled.…

Whole JSON document wrapped in quotes

The document is double-encoded — a JSON string containing JSON, or a shell variable that kept its surrounding quotes.…

Encoding

Curly (smart) quotes in JSON

Typographic quotes U+201C and U+201D instead of the ASCII double quote. Produced by word processors, chat clients, Google Docs and any editor with aut…

UTF-8 BOM before a JSON document

A byte order mark (EF BB BF) at the start of the file. Windows editors, Excel exports and PowerShell's `Out-File` add one by default. RFC 8259 says a …

Parses but wrong

Duplicate keys in a JSON object

The same key appears twice. The JSON specification does not forbid this, and it does not define which value wins — so every parser in this registry ac…

Integer too large for a JSON parser's number type

JSON's grammar permits arbitrary-precision numbers, but most parsers map them onto an IEEE 754 double, which holds integers exactly only up to 2^53−1.…

Parser limits

Deeply nested JSON exceeding a parser's depth limit

Recursive-descent parsers use the call stack for nesting, so past a few hundred levels they either raise a depth error or overflow the stack. Some par…

All 379 messages, grouped by parser

CPython json.loads CPython 3.12.3

Gson Java 21.0.12

Gson JsonParser (lenient off) Java 21.0.12

JSON5 Node.js 22.22.2

JSON::PP Perl 5.038002

Jackson ObjectMapper Java 21.0.12

JavaScriptCore JSON.parse JavaScriptCore (Bun 1.4.1)

Newtonsoft.Json JsonConvert Newtonsoft.Json 13.0.3 on .NET 8.0.30

Ruby JSON.parse Ruby 3.2.3

SpiderMonkey JSON.parse SpiderMonkey 115

System.Text.Json Deserialize .NET 8.0.30

System.Text.Json JsonDocument .NET 8.0.30

V8 JSON.parse Node.js 22.22.2

encoding/json Unmarshal Go go1.22.2

hjson Node.js 22.22.2

json-bigint Node.js 22.22.2

json_decode PHP 8.3.6

orjson CPython 3.12.3

serde_json::from_str Rust (serde_json 1.x)

ujson CPython 3.12.3

How this registry was built

50 malformed JSON documents were each passed to 21 parsers, and the resulting exception message was recorded verbatim along with the runtime version. That produced 1050 observations and 563 distinct raw messages, which collapse to 401 message signatures once byte offsets and line numbers are templated.

Parsers covered: CPython json.loads, Gson, Gson JsonParser (lenient off), JSON5, JSON::PP, Jackson ObjectMapper, JavaScriptCore JSON.parse, Newtonsoft.Json JsonConvert, Newtonsoft.Json JsonTextReader, Ruby JSON.parse, SpiderMonkey JSON.parse, System.Text.Json Deserialize, System.Text.Json JsonDocument, V8 JSON.parse, encoding/json Unmarshal, hjson, json-bigint, json_decode, orjson, serde_json::from_str, ujson — across 12 runtimes.

All three major browser engines are covered — V8 (Chrome, Edge, Node), SpiderMonkey (Firefox) and JavaScriptCore (Safari) — because a developer searches whatever their browser said, and the three word the same failure completely differently.

Documented gap: older runtime versions. V8 changed its JSON error wording in Node 20, and the earlier phrasing (Unexpected token } in JSON at position 8) is still widely searched. Every observation here records the exact runtime version it came from, so a message-by-version matrix is the natural next step.

Standards this registry is checked against

Only standards bodies and peer-reviewed venues are cited. Error strings on this site are observed by executing each parser; the standards above define what the parser is reacting to.

Browse the full tool list — formatting, validation, conversion, patching, canonicalization and type generation, all running in your browser.