Number Base Converter API

Convert numbers between binary, octal, decimal, hexadecimal and any base 2-36 online. Arbitrary precision, clear digit errors — free.

The Number Base Converter is also available as a free REST API. Send a POST request with a JSON body to https://dot.tools/api/tools/number-base — no authentication, no API key, CORS enabled. Successful calls return { "ok": true, "result": { … } }; failures return HTTP 400 or 422 with an error body.

Request body

FieldTypeRequiredDescription
valuestringrequiredThe number to convert, written in fromBase. Digits 0-9 and a-z (case-insensitive); optional leading - or + sign. 0x/0b/0o prefixes are accepted only when they match fromBase (16/2/8). Negative values convert sign-magnitude: the minus sign is carried to every output.
fromBaseintegerrequiredThe base the value is written in, 2-36.
toBaseintegeroptionalOptional extra base to convert into, returned as custom.

Response

FieldTypeRequiredDescription
binaryunknownrequiredBase-2 representation.
octalunknownrequiredBase-8 representation.
decimalunknownrequiredBase-10 representation.
hexadecimalunknownrequiredBase-16 representation, uppercase A-F.
customunknownrequiredValue in toBase when one was provided, otherwise null.
errorunknownrequiredError message when the input could not be converted.

Example request

curl -X POST https://dot.tools/api/tools/number-base \
  -H 'Content-Type: application/json' \
  -d '{
  "value": "255",
  "fromBase": 10
}'

Sample response

{
  "ok": true,
  "result": {
    "binary": "11111111",
    "octal": "377",
    "decimal": "255",
    "hexadecimal": "FF",
    "custom": null,
    "error": null
  }
}

Use the free Number Base Converter in your browser, read the Number Base Converter guide, or import the full OpenAPI specification.