Invalid Number Format in JSON
JSON numbers have strict formatting rules. They cannot have leading zeros (except 0 itself), cannot use hexadecimal (0xFF), cannot have a trailing decimal point (10.), and cannot start with a plus sign (+10). Only standard decimal notation and scientific notation (1.5e10) are allowed.
Why It Matters
The JSON parser rejects the document at the invalid number. This commonly occurs when copying numbers from programming languages that have more flexible number formatting rules.
Code Examples
{
"count": 01,
"hex": 0xFF,
"price": 10.,
"positive": +5,
"octal": 0755
}{
"count": 1,
"hex": 255,
"price": 10.0,
"positive": 5,
"octal": 493
}How to Fix
- 1Remove leading zeros from numbers. Use 1 not 01, use 7 not 007.
- 2Convert hexadecimal values to decimal: 0xFF becomes 255.
- 3Always include a digit after the decimal point: 10.0 not 10.
- 4Remove the plus sign from positive numbers: 5 not +5.
Check Your JSON Now
Our JSON validator detects this error automatically and shows the exact line and column.
Open JSON ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated JSON APIs on reliable hosting.
Related JSON Errors
Invalid Value Type in JSON
JSON only supports strings, numbers, booleans, null, objects, and arrays. Learn how to fix invalid value types.
Unexpected Token in JSON
Learn why JSON throws an unexpected token error and how to fix it. Common causes include trailing commas, single quotes, and unquoted keys.
Invalid Escape Characters in JSON
Learn which escape sequences are valid in JSON strings and how to fix invalid ones.