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 / ':' expected, at character offset N (before "…")
JSON::PP · Perl 5.038002

':' expected, at character offset N (before "…")

This message comes from JSON::PP on Perl 5.038002. 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

Missing colon after an object key

Input
{"a" 1}

Exact message: ':' expected, at character offset 5 (before "1}")

Fix: Insert a colon between the key and the value.

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.loadsExpecting ':' delimiter: line L column C (char N)
GsonExpected ':' at line L column C path $…
Gson JsonParser (lenient off)Expected ':' at line L column C path $…
JSON5JSON5: invalid character '1' at 1:6
Jackson ObjectMapperUnexpected character ('1' (code 49)): was expecting a colon to separate field name and value
JavaScriptCore JSON.parseJSON Parse error: Expected ':' before value in object property definition
Newtonsoft.Json JsonConvertInvalid character after parsing property name. Expected ':' but got: 1. Path '', line L, position N.
Newtonsoft.Json JsonTextReaderInvalid character after parsing property name. Expected ':' but got: 1. Path '', line L, position N.
Ruby JSON.parseunexpected token at '…'
SpiderMonkey JSON.parseJSON.parse: expected ':' after property name in object at line L column C of the JSON data
System.Text.Json Deserialize'1' is invalid after a property name. Expected a ':'. Path: $ | LineNumber: L | BytePositionInLine: C.
System.Text.Json JsonDocument'1' is invalid after a property name. Expected a ':'. LineNumber: L | BytePositionInLine: C.
V8 JSON.parseExpected ':' after property name in JSON at position N (line L column C)
encoding/json Unmarshalinvalid character '1' after object key
hjsonExpected ':' instead of '1' at line L,5
json-bigintExpected ':' instead of '1'
json_decodeSyntax error
orjsonunexpected character, expected ':' after key: line L column C (char N)
serde_json::from_strexpected `:` at line L column C
ujsonNo ':' found when decoding object 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.