Number Base converter
Rewrite whole numbers in another base.
Converter
Quick pairs
tap to loadThe four bases side by side
| Decimal | Binary (base 2) | Octal (base 8) | Decimal (base 10) | Hexadecimal (base 16) |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 | 2 |
| 5 | 101 | 5 | 5 | 5 |
| 8 | 1000 | 10 | 8 | 8 |
| 10 | 1010 | 12 | 10 | A |
| 15 | 1111 | 17 | 15 | F |
| 16 | 10000 | 20 | 16 | 10 |
| 31 | 11111 | 37 | 31 | 1F |
| 32 | 100000 | 40 | 32 | 20 |
| 64 | 1000000 | 100 | 64 | 40 |
| 100 | 1100100 | 144 | 100 | 64 |
| 128 | 10000000 | 200 | 128 | 80 |
| 255 | 11111111 | 377 | 255 | FF |
| 256 | 100000000 | 400 | 256 | 100 |
| 1000 | 1111101000 | 1750 | 1000 | 3E8 |
| 1024 | 10000000000 | 2000 | 1024 | 400 |
Popular number base conversions
2 pagesHow the decimal (base 10) to binary (base 2) conversion works
Binary, octal, decimal, hexadecimal, and every other base in this list are all positional notation systems — the same idea applied with a different number of digit symbols. In any base b, each digit's contribution to the total value is the digit multiplied by b raised to that digit's position, counting from zero at the rightmost digit; decimal is simply the base-10 case everyone learns first, and the other bases work by exactly the same rule with a different b.
To read a number in any base as a decimal value, multiply each digit by the base raised to its position and add the results. Binary 1011 is 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11, and hexadecimal 2F is 2×16¹ + 15×16⁰ = 32 + 15 = 47 (the hex digit F stands for the value 15).
Going the other way — decimal to another base — repeatedly divide by the target base and record the remainder at each step, then read the remainders from last to first. Converting decimal 47 to binary: 47÷2=23 r1, 23÷2=11 r1, 11÷2=5 r1, 5÷2=2 r1, 2÷2=1 r0, 1÷2=0 r1; reading the remainders bottom-to-top gives 101111, which checks out against the hex example above since 47 is the same value as hexadecimal 2F.
Binary and hexadecimal convert into each other without passing through decimal at all, because 16 is exactly 2⁴: group the binary digits into sets of four from the right and convert each group independently. Binary 101111 padded to 00101111 splits into 0010 and 1111, which are hex 2 and F — giving 2F, the same answer as converting through decimal.
Binary and hexadecimal are the two bases built into how computers represent and display data — memory addresses, color codes, and byte values are almost always shown in hex because it packs four bits into one readable character — while octal once served a similar compact role and still appears in Unix file-permission notation, and higher bases like base 32 or base 36 are used in short-code schemes such as URL shorteners and ID generators, where every character needs to carry as much information as possible.
A base only has digit symbols for values from 0 up to one less than the base — base 8 has no digit "8" or "9," for instance — so bases above 10 borrow letters (A for 10, B for 11, and on up to Z for 35 in base 36) to represent the extra values, and forgetting that letters are standing in for numbers is a common source of errors when converting by hand. The other frequent mistake is reading the remainders from a decimal-to-base conversion in the wrong order: they come out last-first, not first-last, so the very first remainder calculated is actually the last digit of the answer.
Leading zeros can also be added or removed freely in any base without changing a number's value, which is why binary numbers are often padded out to a fixed width — 8, 16, or 32 digits — when working with computer memory; the padding is purely a formatting convention for lining values up consistently, not a change to the underlying number being represented.
Questions
How do I convert a binary number to decimal by hand?
Multiply each digit by 2 raised to its position (counting from 0 on the right) and add the results. For binary 1101: 1×8 + 1×4 + 0×2 + 1×1 = 13.
Why does computing rely on hexadecimal instead of pure binary?
Because 16 is 2⁴, every hexadecimal digit represents exactly four binary digits, so a byte (8 bits) becomes a tidy two-character hex value instead of a long string of 0s and 1s — that's why memory addresses and color codes like #2F8A1C are written in hex rather than binary.
What's the largest digit allowed in a given base?
A base b only uses digits from 0 up to b−1. Base 8 stops at 7, base 10 stops at 9, and bases above 10 borrow letters for the extra values — base 16 goes up to F (15), and base 36 goes all the way up to Z (35).
Which number bases does this converter cover?
14 in total, from binary (base 2) up to base 36, including every commonly used base — binary, octal, decimal, and hexadecimal — plus the less common base 3, 4, 5, 6, 7, 9, 12, 20, and 32. Pick any two from the dropdown lists to convert between them directly.
Is there a faster way to convert between binary and hexadecimal than going through decimal?
Yes — group the binary digits into sets of four from the right (padding with leading zeros if needed) and convert each group straight to its hex digit, since 16 equals 2⁴. Binary 101111 becomes 0010 1111, which reads directly as hex 2F, skipping the decimal step entirely.
More on precision and what leaves your device: see About and Privacy policy.