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 / Unexpected number in JSON at position N (line L co
V8 JSON.parse · Node.js 22.22.2

Unexpected number in JSON at position N (line L column C)

This message comes from V8 JSON.parse on Node.js 22.22.2. 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

Leading zero in a JSON number

Input
{"a": 013}

Exact message: Unexpected number in JSON at position 7 (line 1 column 8)

Fix: Quote it. `"013"` is a string and keeps its padding; `13` is a number and does not.

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)
JSON5JSON5: invalid character '1' at 1:8
JSON::PPmalformed number (leading zero must not be followed by another digit), at character offset N (before "…")
Jackson ObjectMapperInvalid numeric value: Leading zeroes not allowed
JavaScriptCore JSON.parseJSON Parse error: Expected '}'
Ruby JSON.parseunexpected token at '…'
SpiderMonkey JSON.parseJSON.parse: expected ',' or '}' after property value in object at line L column C of the JSON data
System.Text.Json DeserializeInvalid leading zero before '1'. Path: $ | LineNumber: L | BytePositionInLine: C.
System.Text.Json JsonDocumentInvalid leading zero before '1'. LineNumber: L | BytePositionInLine: C.
encoding/json Unmarshalinvalid character '1' after object key:value pair
hjsonEnd of input while parsing an object (missing '}') at line L,10
json_decodeSyntax error
orjsonnumber with leading zero is not allowed: line L column C (char N)
serde_json::from_strinvalid number at line L column C

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