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
| Field | Type | Required | Description |
|---|---|---|---|
value | string | required | The 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. |
fromBase | integer | required | The base the value is written in, 2-36. |
toBase | integer | optional | Optional extra base to convert into, returned as custom. |
Response
| Field | Type | Required | Description |
|---|---|---|---|
binary | unknown | required | Base-2 representation. |
octal | unknown | required | Base-8 representation. |
decimal | unknown | required | Base-10 representation. |
hexadecimal | unknown | required | Base-16 representation, uppercase A-F. |
custom | unknown | required | Value in toBase when one was provided, otherwise null. |
error | unknown | required | Error 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.