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 / JSON Parse error: Unrecognized token ''
JavaScriptCore JSON.parse · JavaScriptCore (Bun 1.4.1)

JSON Parse error: Unrecognized token ''

This message comes from JavaScriptCore JSON.parse on JavaScriptCore (Bun 1.4.1). In this registry it is produced by 1 distinct mistake. Positions in the real message vary with your input; the causes do not.

What produces this message

UTF-8 BOM before a JSON document

Input
{"a": 1}

Exact message: JSON Parse error: Unrecognized token ''

Fix: Save the file as UTF-8 without BOM. In PowerShell use `Set-Content -Encoding utf8NoBOM`; in Notepad choose 'UTF-8' rather than 'UTF-8 with BOM'.

What other parsers say about the same input

If a colleague reports a different message for what looks like the same file, this is why.

Parser Message for the same inputs
CPython json.loadsUnexpected UTF-8 BOM (decode using utf-8-sig): line L column C (char N)
JSON::PPmalformed JSON string, neither array, object, number, string or atom, at character offset N (before "…")
Jackson ObjectMapperUnexpected character ('?' (code 65279 / 0xfeff)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
Newtonsoft.Json JsonConvertUnexpected character encountered while parsing value: . Path '', line L, position N.
Newtonsoft.Json JsonTextReaderUnexpected character encountered while parsing value: . Path '', line L, position N.
Ruby JSON.parseunexpected token at '…'
SpiderMonkey JSON.parseJSON.parse: unexpected character at line L column C of the JSON data
System.Text.Json Deserialize'0xEF' is an invalid start of a value. Path: $ | LineNumber: L | BytePositionInLine: C.
System.Text.Json JsonDocument'0xEF' is an invalid start of a value. LineNumber: L | BytePositionInLine: C.
V8 JSON.parseUnexpected token '', "{"a": 1}" is not valid JSON
encoding/json Unmarshalinvalid character 'ï' looking for beginning of value
json-bigintUnexpected ''
json_decodeSyntax error
orjsonUTF-8 byte order mark (BOM) is not supported: line L column C (char N)
serde_json::from_strexpected value at line L column C
ujsonExpected object or value

← All JSON parser errors

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.