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 / invalid number at line L column C
serde_json::from_str · Rust (serde_json 1.x)

invalid number at line L column C

This message comes from serde_json::from_str on Rust (serde_json 1.x). In this registry it is produced by 3 distinct mistakes. Positions in the real message vary with your input; the causes do not.

What produces this message

Bare minus sign where a number was expected

Input
{"a": -}

Exact message: invalid number at line 1 column 8

Fix: Emit `null` or `0` when the value is missing, and check your template for an unsubstituted placeholder.

Leading zero in a JSON number

Input
{"a": 013}

Exact message: invalid number at line 1 column 8

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

Trailing decimal point in a JSON number

Input
{"a": 1.}

Exact message: invalid number at line 1 column 9

Fix: Write `1.0` or `1`.

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)Expecting value: line L column C (char N)
JSON5JSON5: invalid character '1' at 1:8JSON5: invalid character '}' at 1:8
JSON::PPmalformed number (leading zero must not be followed by another digit), at character offset N (before "…")malformed number (no digits after decimal point), at character offset N (before "…")malformed number (no digits after initial minus), at character offset N (before "…")
Jackson ObjectMapperInvalid numeric value: Leading zeroes not allowedUnexpected character ('}' (code 125)) in numeric value: Decimal point not followed by a digitUnexpected character ('}' (code 125)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value
JavaScriptCore JSON.parseJSON Parse error: Expected '}'JSON Parse error: Invalid digits after decimal pointJSON Parse error: Invalid number
Newtonsoft.Json JsonConvertInput string '-' is not a valid number. Path 'a', line L, position N.
Newtonsoft.Json JsonTextReaderInput string '-' is not a valid number. Path 'a', line L, position N.
Ruby JSON.parseunexpected token at '…'
SpiderMonkey JSON.parseJSON.parse: expected ',' or '}' after property value in object at line L column C of the JSON dataJSON.parse: unexpected non-digit at line L column C of the JSON dataJSON.parse: unterminated fractional number at line L column C of the JSON data
System.Text.Json Deserialize'}' is invalid within a number, immediately after a decimal point ('.'). Expected a digit ('0'-'9'). Path: $ | LineNumber: L | BytePositionInLine: C.'}' is invalid within a number, immediately after a sign character ('+' or '-'). Expected a digit ('0'-'9'). Path: $ | LineNumber: L | BytePositionInLine: C.Invalid leading zero before '1'. Path: $ | LineNumber: L | BytePositionInLine: C.
System.Text.Json JsonDocument'}' is invalid within a number, immediately after a decimal point ('.'). Expected a digit ('0'-'9'). LineNumber: L | BytePositionInLine: C.'}' is invalid within a number, immediately after a sign character ('+' or '-'). Expected a digit ('0'-'9'). LineNumber: L | BytePositionInLine: C.Invalid leading zero before '1'. LineNumber: L | BytePositionInLine: C.
V8 JSON.parseNo number after minus sign in JSON at position N (line L column C)Unexpected number in JSON at position N (line L column C)Unterminated fractional number in JSON at position N (line L column C)
encoding/json Unmarshalinvalid character '1' after object key:value pairinvalid character '}' after decimal point in numeric literalinvalid character '}' in numeric literal
hjsonEnd of input while parsing an object (missing '}') at line L,10End of input while parsing an object (missing '}') at line L,8
json-bigintBad number
json_decodeSyntax error
orjsonno digit after decimal point: line L column C (char N)no digit after sign: line L column C (char N)number with leading zero is not allowed: line L column C (char N)

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