About this calculator
Type a whole number, say which base it is in, and this converter shows it in binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) at once.
It works exactly with very large numbers too (up to 64 digits), and tells you how many bits the number needs.
Worked examples
Real numbers, worked out by the same calculator. Press “Use these numbers” to try one above.
255 in decimal
- Binary
- 1111 1111
- Octal
- 377
- Hexadecimal
- FF
- Bits needed
- 8
255 in decimal is 11111111 in binary and FF in hexadecimal.
Show the working
- Keep dividing 255 by 2 and write down the remainders, last one first: 11111111.
- Group the binary digits in fours to read hexadecimal: FF.
FF in hexadecimal
- Binary
- 1111 1111
- Octal
- 377
- Decimal
- 255
- Bits needed
- 8
FF in hexadecimal is 255 in decimal and 11111111 in binary.
Show the working
- Each hexadecimal digit is worth a power of 16. Adding them up gives 255 in decimal.
- In binary that is 11111111 and in hexadecimal FF.
101101 in binary
- Octal
- 55
- Decimal
- 45
- Hexadecimal
- 2D
- Bits needed
- 6
101101 in binary is 45 in decimal and 2D in hexadecimal.
Show the working
- Each binary digit is worth a power of 2. Adding them up gives 45 in decimal.
- In binary that is 101101 and in hexadecimal 2D.
How number bases work
In decimal each digit is worth ten times the one to its right: 255 means 2×100 + 5×10 + 5×1. Other bases work the same way with a different multiplier. In binary each place is worth twice the last (1, 2, 4, 8, 16…), so 101101 means 32 + 8 + 4 + 1 = 45.
Hexadecimal needs sixteen digit symbols, so it uses 0–9 and then A to F for ten to fifteen. Octal uses the digits 0 to 7.
Converting decimal to binary by hand
Divide the number by 2, write down the remainder, and repeat with the answer until you reach 0. Read the remainders from last to first. For 13: 13÷2 = 6 r 1; 6÷2 = 3 r 0; 3÷2 = 1 r 1; 1÷2 = 0 r 1. Reading upwards gives 1101.
Why hexadecimal is used
Four binary digits make exactly one hexadecimal digit, so hex is a compact way to write long binary numbers. That is why colours (#FF8800), memory addresses and byte values are shown in hex.
| Decimal | Binary | Hex |
|---|---|---|
| 10 | 1010 | A |
| 15 | 1111 | F |
| 16 | 10000 | 10 |
| 255 | 11111111 | FF |
Frequently asked questions
How do I convert binary to decimal?
Add up the value of each place where there is a 1. The places are worth 1, 2, 4, 8, 16 and so on, from the right.
What is 255 in binary?
255 is 11111111 in binary (eight ones) and FF in hexadecimal.
Can I type 0x or 0b before the number?
Yes. A leading 0x (hex) or 0b (binary) is ignored.
Does it handle negative numbers or fractions?
No. It converts whole, non-negative numbers.
Formulas tested against hand-worked answers. Last reviewed 29 September 2026. These calculators do arithmetic only; they are not financial, tax or legal advice.