developer

Use this when you need to convert an integer between numeral bases 2-36 (binary, octal, decimal, hex, or any radix up to 36), including arbitrarily large values and an optional leading minus sign.

Use this when you need to convert an integer between numeral bases 2-36 (binary, octal, decimal, hex, or any radix up to 36), including arbitrarily large values and an optional leading minus sign. Uses BigInt so there is no precision loss, and output digits are lowercase. Deterministic: same input, same output. Example: { value: "ff", from: 16 } -> decimal "255", results.base2 "11111111". Prefer this over doing base/digit conversion in your head, which is an error-prone bit-fiddling task. If to is omitted it converts to bases 2, 8, 10, and 16 (excluding the source base).

post/v1/convert_number_base

Request

  • Base URL: https://api.clean.tools
  • URL: https://api.clean.tools/v1/convert_number_base
  • Auth: none declared

Request body

valuestring required

The number to convert, as a string so huge values are not truncated. Digits are case-insensitive (a-z = 10-35) and an optional leading "-" is allowed, e.g. "ff", "-1010", "HELLOWORLD123".

frominteger required

The base the input value is written in (2-36).

Response

Structured tool result.

toolstring

Changes

No recorded changes to this operation across all 1 revision of this API.