Radix converter
Rewrites a whole number from any base between 2 and 36 into another: hexadecimal FF is 255 in decimal. Every digit is checked against its base, so an illegal digit is flagged instead of guessed. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Value
- FF
- Source numeral base
- 16
- Target numeral base
- 10
- Result
- 255
- Normalized
- FF
- Decimal
- 255
- Digit count
- 3
A radix converter rewrites the same integer in a different numeral base without changing its value. Binary, octal, decimal, and hexadecimal show up daily in programming classes, network masks, color codes, and embedded firmware, and bases beyond sixteen appear in compact serial schemes and programming-contest problems. This tool accepts an integer written with digits zero through nine and letters A through Z in any source base from two to thirty-six, checks that every digit is legal for that base, then emits the equivalent string in the target base.
How base conversion preserves the integer value
An integer in base b is a weighted sum of its digits: the rightmost digit is worth one, the next digit is worth b, then b squared, and so on. Converting from base b to base k means recovering that unique non-negative integer and rewriting it with weights that are powers of k. Practically, the converter walks the source string left to right, multiplies the running total by the source base, and adds each digit value after confirming the digit is strictly less than the source base.
Digits zero through nine map to themselves; letters A through Z (case-insensitive) map to ten through thirty-five. Once the absolute integer is known, the target representation is produced by repeated division by the target base, collecting remainders as digits and reading them from last remainder to first. Zero is a single digit zero in every base.
A leading minus sign is preserved for non-zero values; plus signs are accepted and dropped. Leading zeros in the source are ignored for the value but the response also returns a normalized uppercase form without unnecessary leading zeros so callers can compare strings deterministically. The absolute decimal magnitude is capped at the JavaScript safe-integer limit so every remainder and place-value step stays exact—no floating-point drift, no external libraries, and no network calls of any kind.
Where radix conversion shows up in real work
Students debugging bitwise homework need a trustworthy oracle that flags an illegal digit instead of silently wrapping or inventing a result. Firmware and networking engineers bounce between binary masks, octal permission bits, and hexadecimal register dumps when documenting a device or reviewing a capture. Product teams that mint compact alphanumeric codes in bases above ten still need a decimal audit trail for support tools and warehouses.
If you later need Base64 binary encoding, unit conversion for physical quantities, or a digit-sum in a chosen base, those are separate search intents and separate landings rather than overloads of this radix converter.
What you can do with it
Classroom binary, octal, and hex drills
Convert homework values between bases 2, 8, 10, and 16 with clear invalid-digit errors students can fix.
Firmware and network register dumps
Rewrite hex register values as binary bit strings or decimal counts for docs, tickets, and code reviews.
FAQ
Which bases are supported?
Any integer base from 2 through 36 for both source and target. Digits use 0-9 then A-Z (case-insensitive on input).
Are letters case-sensitive?
Input letters are case-insensitive. Output always uses uppercase A-Z for digits ten and above.
How are negative numbers handled?
An optional leading minus is accepted. The absolute value is converted and the sign is restored on non-zero results.
What does it cost?
The browser tool is free and runs locally.
How do I write 255 in binary?
As eight ones in a row. Choose 10 as the source base and 2 as the target base; the same number is FF in hexadecimal, because 255 is the largest value that fits in eight binary digits.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/numth/radix-convert \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"value":"FF","from_base":16,"to_base":10}'const res = await fetch("https://api.kit.forhosting.com/numth/radix-convert", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"value": "FF",
"from_base": 16,
"to_base": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/radix-convert",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"value": "FF",
"from_base": 16,
"to_base": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/radix-convert", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"value":"FF","from_base":16,"to_base":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"value":"FF","from_base":16,"to_base":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/radix-convert", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"value": "FF",
"from_base": 16,
"to_base": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.radix_convert",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
min_base | 2 |
max_base | 36 |
max_value_chars | 64 |
max_abs_decimal | 9007199254740991 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What you send and what you get back
Classic checks include hexadecimal FF to decimal two hundred fifty-five, decimal two hundred fifty-five to binary eight ones, and octal seven five five to decimal four hundred ninety-three. Provide three fields: value as the integer text in the source alphabet, from_base as an integer from two through thirty-six, and to_base as the destination base in the same range. Aliases are accepted for friendlier forms: number, n, input, or text for the value; from, source_base, base_from, or src_base for the source base; to, target_base, base_to, or dst_base for the target base. Missing fields, non-integer bases, bases outside two through thirty-six, empty values, illegal characters, digits that are too large for the source base, bodies longer than sixty-four significant characters, or magnitudes beyond the safe-integer limit are rejected with invalid_input and are not charged. On success the response echoes the original value string and the effective bases, supplies normalized as the canonical signed uppercase form, decimal as the signed integer in base ten, result as the converted string in the target base, negative as a boolean, and digit_count as the number of digits in the absolute result body.
Where radix conversion shows up in real work
Because this capability is a pure parse engine, the same value and bases always produce the same JSON with no model drift and no stored state. API pricing is the published base of $0.002 per successful item; failed validation does not consume balance.
Integration use cases
Contest and CI golden fixtures
Generate deterministic base-b strings from known integers for programming-contest tests and pipeline assertions.
Technical questions
What happens if a digit is invalid for the source base?
The request fails with invalid_input, naming the bad character and the allowed digit range. Invalid input is not charged.