The same JSON error, worded three completely different ways
Chrome, Firefox and Safari use different JavaScript engines, and each writes its own JSON error messages. A developer searches whatever their browser printed — so all three matter.
Almost no words in common
| Broken input | V8 (Chrome, Edge, Node) | SpiderMonkey (Firefox) | JavaScriptCore (Safari) |
|---|---|---|---|
| Trailing comma | Expected double-quoted property name in JSON at position 8 (line 1 col | JSON.parse: expected double-quoted property name at line 1 column 9 of | JSON Parse error: Property name must be a string literal |
| Single-quoted string | Expected property name or '}' in JSON at position 1 (line 1 column 2) | JSON.parse: expected property name or '}' at line 1 column 2 of the JS | JSON Parse error: Single quotes (') are not allowed in JSON |
| Unclosed object | Expected ',' or '}' after property value in JSON at position 7 (line 1 | JSON.parse: end of data after property value in object at line 1 colum | JSON Parse error: Expected '}' |
| HTML instead of JSON | Unexpected token '<', "<!DOCTYPE "... is not valid JSON | JSON.parse: unexpected character at line 1 column 1 of the JSON data | JSON Parse error: Unrecognized token '<' |
Captured by running each engine directly: Node 22 (V8), the SpiderMonkey 115 shell, and JavaScriptCore via Bun.
Your error message is not the only error message
A trailing comma produces Expected double-quoted property name in JSON at position 8 in Chrome, JSON.parse: expected double-quoted property name at line 1 column 9 of the JSON data in Firefox, and JSON Parse error: Property name must be a string literal in Safari. Same bug, three sentences with barely a word in common.
If you write documentation, a troubleshooting page, or an error-handling branch that matches on message text, it will only work for one third of your users.
V8 also changed its own wording in Node 20. Anything written before that — including most of the answers you will find searching — quotes the older phrasing.
21 parsers, 12 runtimes
The same divergence exists across languages. The JSON error registry maps 401 distinct message signatures back to 50 underlying causes, so you can paste whatever your runtime printed and find the fix.
Standards referenced
The standards define what is invalid; they say nothing about how an implementation must word its diagnostic. That is why the three engines diverge.
- RFC 8259 (STD 90) §2 — JSON Grammar — The JavaScript Object Notation (JSON) Data Interchange Format, T. Bray, Ed., 2017.
- RFC 8259 (STD 90) §7 — Strings — The JavaScript Object Notation (JSON) Data Interchange Format, T. Bray, Ed., 2017.
- ECMA-404, 2nd edition §text — 4 JSON Text — The JSON Data Interchange Syntax, Ecma International, 2017.
Only standards bodies and peer-reviewed venues are cited here.
How this was measured
Each engine was executed directly rather than consulted. SpiderMonkey via the js115 shell, JavaScriptCore via Bun, V8 via Node — all on the same corpus of malformed documents.
Every figure on this page came from executing the parser named, not from documentation. The collection harness is public — see the error registry method notes.