Quick answer
JSON numbers must be decimal.
JSON Invalid Number Format
JSON numbers must be decimal. No leading zeros (except 0.x), no NaN or Infinity, no hex or octal.
Common causes
- Leading zero in integers (e.g. 07).
- Using NaN or Infinity.
- Using hex (0xff) or scientific notation with invalid form.
- Extra decimal point or invalid exponent.
How to fix
- Remove leading zeros; use 7 not 07.
- Use null or a string if you need to represent NaN/Infinity.
- Use standard decimal or valid scientific notation (e.g. 1e2).
Examples
Bad
{"n": 07}Good
{"n": 7}FAQ
- Can JSON have leading zeros in numbers?
- No. 07 is invalid; use 7.
- Can I use Infinity in JSON?
- No. Use null or a string, or omit the value.
Fix it now
Try in validator (prefill this example)