Base (radix) converter
Convert binary, octal, decimal, hex and custom bases for big numbers.
| Binary | - |
|---|---|
| Octal | - |
| Decimal | - |
| Hex | - |
You are reading someone else's code and run into 0xFF, a permission mask of 755, or a bit flag written in binary. None of those translate in your head instantly, and reaching for a calculator app breaks your train of thought.
This converter takes a single value plus the base it is written in, then shows the binary, octal, decimal and hexadecimal forms together as you type. There is no convert button — every keystroke updates all four rows.
How it works
What you enter
The form has two fields, and a third that appears only when you need it.
| Field | What it does |
|---|---|
| Input value | The number to convert. Letters are allowed for bases above 10 (ff, 2af, zz) |
| Input base | Tells the tool how to read that value — Decimal, Binary, Octal, Hex, or Other (custom) |
| Custom base (2-36) | Appears when you pick "Other (custom)". Accepts any base from 2 through 36 |
Results appear underneath as four rows — Binary, Octal, Decimal, Hex. Hex output is uppercase (2AF), while input is case-insensitive, so ff and FF are the same value.
How the conversion works
Every conversion goes through one intermediate step. The tool first expands your input using positional weights to get a single quantity, then divides that quantity down into the target base. Hexadecimal 2AF, for example, reads as:
2 x 16² = 512A (=10) x 16¹ = 160F (=15) x 16⁰ = 15- total: 687
That 687 is then repeatedly divided by 2 to produce binary 1010101111, and by 8 to produce octal 1257. Whatever base you start from, everything funnels through one common value before fanning back out — which is why the four outputs can never disagree with each other.
Large numbers, prefixes and signs
Arithmetic runs on arbitrary-precision integers rather than floating point, so a fifty-digit input keeps every digit instead of losing the tail to rounding. A few input conveniences are worth knowing:
- A leading
0x,0bor0oprefix is stripped, so pasting0xFFstraight from source code works. - A leading minus sign is carried through to the results.
- Digits are limited to
0-9andA-Z, which is exactly 36 symbols — hence the ceiling of base 36.
When results go blank
Fractional input is not supported; this is an integer converter. If a character does not exist in the base you selected — a 9 under octal, a 2 under binary — the tool clears the four rows and shows an "Invalid value for base N" message. That almost always means the Input base dropdown is set to something other than what you actually pasted.
Terms explained
- Base (radix)
- How many distinct symbols one digit position can hold. Base 10 uses 0-9; base 16 adds A-F for ten more values.
- Binary
- Base 2, using only 0 and 1. It mirrors how hardware actually stores a value, so bit masks and flags are usually read this way.
- Octal
- Base 8, using 0-7. Each octal digit covers exactly three bits, which is why Unix file permissions appear as 755 or 644.
- Hex
- Base 16, using 0-9 and A-F. One hex character packs four bits, making it compact for colour codes (#FF8800) and memory addresses.
- Positional weight
- The rule that each digit is worth the base raised to its position. The third hex digit from the right carries a weight of 16² = 256.
- Arbitrary-precision integer
- A number type with no fixed width, so digits are never dropped no matter how long the value grows.
Frequently asked questions
Why does hex ff equal 255?
The left f is worth 15 x 16 = 240 and the right f is worth 15 x 1 = 15, which totals 255. That is also the largest value a single byte can hold, which is why FF shows up so often in colour codes and memory dumps.
Can it convert decimals or fractions?
No. This is an integer converter, so a decimal point makes the input invalid. Convert the whole-number part here and handle the fractional part separately if you need it.
What is the custom base field for?
Bases that are not in the dropdown — base 3, base 5, base 32 and so on. Choose "Other (custom)" under Input base and the field appears, accepting anything from 2 to 36.
Are very large numbers still exact?
Yes. Calculations use arbitrary-precision integers rather than floating point, so nothing is rounded off the end. The only practical limit is that output strings get long.
All four results show a dash. What happened?
One of your characters does not exist in the selected base. Setting Input base to Binary and typing 123 will do it, since binary has no 2 or 3. Check that the dropdown matches what you pasted.
Tell us what went wrong and we'll fix it fast. (Leave an email if you'd like a reply.)