Base Number Converter

Convert numbers between any bases (2–36) with binary, octal, decimal, and hex output

GET 1 credit /v1/base-convert
curl "https://devtools.toolkitapi.io/v1/base-convert?value=255&from_base=10&to_base=16"
import httpx

resp = httpx.get(
    "https://devtools.toolkitapi.io/v1/base-convert?value=255&from_base=10&to_base=16",
)
print(resp.json())
const resp = await fetch("https://devtools.toolkitapi.io/v1/base-convert?value=255&from_base=10&to_base=16", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "input": "255",
  "from_base": 10,
  "to_base": 16,
  "decimal": 255,
  "result": "FF",
  "all_bases": {
    "binary": "11111111",
    "octal": "377",
    "decimal": "255",
    "hexadecimal": "FF"
  }
}

Try It Live

Live Demo

Description

Convert numbers between any bases (2–36) with binary, octal, decimal, and hex output

How to Use

1

1. Pass the number as `value`, its current base as `from_base`, and the target base as `to_base`.

2

2. The `result` field contains the converted value in the target base.

3

3. The `all_bases` object always provides the value in binary (2), octal (8), decimal (10), and hexadecimal (16) regardless of the target base.

About This Tool

Base Number Converter converts a number from any base (2–36) to any other base, and always includes the value in binary, octal, decimal, and hexadecimal for quick reference.

Pass a value in its source base and the target base, and get back the converted result plus all four standard representations.

Why Use This Tool

Frequently Asked Questions

What bases are supported?
Any base from 2 to 36. Digits beyond 9 use uppercase letters A–Z (e.g. base 16 uses 0–9 and A–F).
Does it support negative numbers?
Yes. Negative results are prefixed with `-` in all output representations.
What if the value isn't valid for the source base?
An error is returned, e.g. `"'G' is not a valid base-16 number"`.

Start using Base Number Converter now

Get your free API key and make your first request in under a minute.