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

InputsResult
Decimal number255Binary: 11111111Octal: 377Hexadecimal: FFBinary digits needed: 8
Show 3 more examples
Decimal number10Binary: 1010Octal: 12Hexadecimal: ABinary digits needed: 4
Decimal number4,096Binary: 1000000000000Octal: 10000Hexadecimal: 1000Binary digits needed: 13
Decimal number65,535Binary: 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 numberBinary
15010010110
20011001000
25011111010
255starting value11111111
300100101100
350101011110

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₀
bBase: 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.