JSON Number
A numeric value that can be an integer or a floating-point number. It is not enclosed in quotes.
Numbers in JSON follow the standard double-precision floating-point format. They are written without quotes. JSON does not distinguish between integers and floating-point numbers, nor does it support formats like octal, hexadecimal, or non-numeric values like NaN
or Infinity
.
Valid vs. Invalid
- Valid:
123
,-45.6
,0.1e-5
- Invalid:
0123
(leading zeros are not allowed),1,000
(commas are not allowed),"123"
(this is a string, not a number).