Skip to content

Main content

JSON Integer Decimal Equivalence Token Tool

Classify a strict JSON number token after binary64 conversion; lexical precision beyond binary64 is not preserved.

Loading tool…

Description

Test JSON number grammar first; invalid tokens return false flags and an empty canonical string.

A JSON number's grammar, decimal spelling, and parsed binary value are different layers. Exponents, leading zeros, and negative zero can carry lexical information lost during numeric conversion.

Test JSON number grammar first; invalid tokens return false flags and an empty canonical string.

When to use this tool

Use JSON Integer Decimal Equivalence Token when you need a numeric token's spelling or serialization convention.

How to use the tool and how it works

  1. Enter token. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read validNumberToken, integerValue, canonical. Inspect validNumberToken, integerValue before interpreting the associated values.

Test JSON number grammar first; invalid tokens return false flags and an empty canonical string. Valid tokens convert to a finite Number, report Number.isInteger, and serialize that value.1

Input fieldMeaning and unitsAccepted input
tokenTokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
validNumberTokenValid Number TokenRequired. Boolean.
integerValueInteger ValueRequired. Boolean.
canonicalJavaScript serialization after finite binary Number conversion; may lose decimal precision.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "token": "1.0"
  },
  "output": {
    "validNumberToken": true,
    "integerValue": true,
    "canonical": "1"
  }
}

Limitations and assumptions

  • Large integers can round and tiny values can underflow; canonical is JavaScript numeric serialization, not exact decimal or full JSON canonicalization.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use an exact decimal parser when preserving large integers, decimal scale, or lexical round trips is required.

References

  1. Calculation and input contract: json/json-integer-decimal-equivalence-token — tool.io

Similar or alternative tools

  • JSON Scalar Nonfinite Serialization Guard

    Accept a numeric-like lexeme including optional plus signs, decimal forms, Infinity, and NaN.

  • JSON Number Scale Token

    Validate a JSON number token, count fractional digits, parse its optional signed exponent as a safe integer, and return decimalScale = fractionDigits - exponent.