Overview
Computers store everything in binary, while people prefer decimal. Hexadecimal is a compact shorthand: each hex digit stands for four bits.
Enter a whole decimal number to see it in binary, octal and hexadecimal.
Worked examples
| Inputs | Result |
|---|---|
| Decimal number255 | Binary: 11111111Octal: 377Hexadecimal: FFBinary digits needed: 8 |
Show 3 more examples
| Decimal number10 | Binary: 1010Octal: 12Hexadecimal: ABinary digits needed: 4 |
| Decimal number4,096 | Binary: 1000000000000Octal: 10000Hexadecimal: 1000Binary digits needed: 13 |
| Decimal number65,535 | Binary: 1111111111111111Octal: 177777Hexadecimal: FFFFBinary digits needed: 16 |
Binary by decimal number
With the calculator's starting values, the binary is 11111111. The table shows how it changes with the decimal number.
| Decimal number | Binary |
|---|---|
| 150 | 10010110 |
| 200 | 11001000 |
| 250 | 11111010 |
| 255starting value | 11111111 |
| 300 | 100101100 |
| 350 | 101011110 |
How it works
To convert to base b, repeatedly divide by b and read the remainders from last to first.
The formula
n = dₖbᵏ + … + d₁b + d₀
| b | Base: 2, 8 or 16 |
| dᵢ | Digits |
Practical tips
- 255 is 11111111 in binary: the largest value in one byte.
- Hex colors like #FF8800 are three bytes: red, green, blue.
Frequently asked questions
What is 10 in binary?
1010.
How many bits does 1,000 need?
10 bits.