</>
ValidateHTML

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

Invalid JSON
{
  "count": 01,
  "hex": 0xFF,
  "price": 10.,
  "positive": +5,
  "octal": 0755
}
Valid JSON
{
  "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 Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated JSON APIs on reliable hosting.

Get 80% Off Hosting →

Related JSON Errors

View all JSON errors