Number Base Converter: How to Convert Between Binary, Octal, Decimal & Hexadecimal
About the Author

A number base converter takes one number and rewrites it in a different counting system — turn decimal 255 into binary 11111111, or hex FF into octal 377, all in a single step. The number itself never changes. Two hundred fifty-five apples are still two hundred fifty-five apples whether you write the count as 255, FF, or 11111111. Only the notation shifts. This guide walks through what a base actually is, how the conversion math works in both directions, and where the four common bases — base 2, 8, 10, and 16 — earn their keep.
A Base Is Just a Bundle Size
Think of a base as how big a bundle you allow before you carry. In base 10 you bundle in tens: once you hit ten ones, you trade them for a single "tens" column. The number 4,072 means 4 thousands, 0 hundreds, 7 tens, and 2 ones — each column is a power of ten (10³, 10², 10¹, 10⁰). Change the base and you only change the bundle size. Base 2 bundles in twos, so the columns are powers of two: 1, 2, 4, 8, 16, 32, and so on. Base 16 bundles in sixteens, which is why it needs six extra digit symbols — A through F — to represent the values 10 through 15 in a single column.
That single idea — "digit times place value, then add" — powers every conversion. The biggest digit you can use is always one less than the base: base 2 uses 0 and 1, base 8 uses 0–7, and base 16 uses 0–9 plus A–F. If you ever see a digit that's too big for its base, like an 8 inside a supposedly octal number, something is wrong.
Every Conversion Routes Through Decimal
Here's the trick that makes converting between any two bases manageable: go through base 10 as a hub. Rather than memorize a direct base-7-to-base-13 procedure, you do it in two stages. First turn the source number into decimal, then turn that decimal into the target base. The calculator above does exactly this, which is why it can handle any base from 2 to 36.
Stage one — source to decimal — uses positional expansion. Take the hex number 2F. The digit 2 sits in the 16¹ place and F (which equals 15) sits in the 16⁰ place: 2 × 16 + 15 × 1 = 32 + 15 = 47. Stage two — decimal to target — uses repeated division. To push 47 into binary, divide by 2 over and over and collect the remainders:
| Step | Division | Quotient | Remainder |
|---|---|---|---|
| 1 | 47 ÷ 2 | 23 | 1 |
| 2 | 23 ÷ 2 | 11 | 1 |
| 3 | 11 ÷ 2 | 5 | 1 |
| 4 | 5 ÷ 2 | 2 | 1 |
| 5 | 2 ÷ 2 | 1 | 0 |
| 6 | 1 ÷ 2 | 0 | 1 |
Read the remainders from bottom to top — 101111 — and you have 47 in binary. The bottom-to-top rule trips people up constantly, so it's worth saying twice: the last remainder you calculate is the first digit of the answer. If you only need plain binary work, the dedicated decimal to binary calculator shows the same division ladder with a binary-only focus.
The Hex–Binary Shortcut Worth Memorizing
Programmers rarely convert hex to binary through decimal, because there's a faster path. Sixteen is two to the fourth power, so every single hex digit maps to exactly four binary digits — no division required. Memorize the sixteen patterns once and you can translate at sight:
| Hex | Binary | Hex | Binary |
|---|---|---|---|
| 0 | 0000 | 8 | 1000 |
| 1 | 0001 | 9 | 1001 |
| 2 | 0010 | A | 1010 |
| 3 | 0011 | B | 1011 |
| 4 | 0100 | C | 1100 |
| 5 | 0101 | D | 1101 |
| 6 | 0110 | E | 1110 |
| 7 | 0111 | F | 1111 |
So hex B8 becomes 1011 1000 by stitching B (1011) next to 8 (1000) — no arithmetic at all. The same logic works for octal in groups of three bits, since 8 is two cubed. This is the real reason hex and octal exist: they're shorthand for binary that humans can actually read. For deeper drills in a single system, the hexadecimal calculator and binary calculator let you add and subtract directly in those bases.
Three Conversions, Start to Finish
Binary 11010 to decimal. Lay out the place values from the right: 16, 8, 4, 2, 1. The digits are 1, 1, 0, 1, 0, so you keep the 16, 8, and 2 columns: 16 + 8 + 2 = 26.
Decimal 250 to hexadecimal. Divide by 16: 250 ÷ 16 = 15 remainder 10. Then 15 ÷ 16 = 0 remainder 15. The remainders 10 and 15 become A and F, read bottom-up, giving FA. Quick check: F is 15 sixteens (240) plus A which is 10, totals 250. Correct.
Octal 752 to binary. Use the three-bit shortcut: 7 = 111, 5 = 101, 2 = 010. Concatenate to get 111101010. Going the long way through decimal (752 octal = 490) and back would land on the same answer, but the grouping trick is far faster.
Where Conversions Go Wrong
- Reading remainders top-down. The division method produces digits in reverse. Always read the remainder column from bottom to top, or your answer comes out mirrored.
- Using a digit that's too big for the base. Writing "19" in base 8 is meaningless — octal stops at 7. The converter above flags the exact offending character instead of guessing.
- Forgetting that letters are digits. In bases above 10, A–F (and beyond, up to Z in base 36) are real digit values, not labels. C in hex is the number 12, full stop.
- Dropping leading zeros in grouped conversions. When expanding hex to binary, every digit must become a full four bits. Hex 1 is 0001, not just 1, or the bit alignment breaks.
Why Computers Care About Base 2, 8, and 16
Computers store everything as binary because a transistor is either on or off — base 2 maps perfectly onto that physical reality. But long binary strings are miserable for humans: a single byte like 11111111 is hard to read and easy to miscount. Hexadecimal compresses that same byte into two tidy digits (FF), which is why colors on the web are hex (#FF5733), memory addresses are hex, and file hashes are hex. Octal shows up in Unix file permissions — chmod 755 is three octal digits, each encoding three permission bits. Understanding base conversion turns those cryptic codes into something you can actually decode. If you want to explore the arithmetic side of a chosen base, the general base calculator handles operations across mixed bases.
When to Reach for This Number Base Converter
- Decoding a hex color, memory address, or RGB value back into decimal you can reason about.
- Checking computer science homework on positional notation without grinding through long division by hand.
- Translating Unix
chmodpermission codes between octal and the underlying binary bits. - Working with unusual bases — base 12, base 20, base 36 — where there's no mental shortcut and you just need a fast, exact answer.



