Binary, Decimal and Hex Conversion Calculator

Type a number in binary, octal, decimal or hex to see it written in all four.

Written in

The base the number is typed in.

Digits 0–9 and letters A–Z; a leading minus sign is kept.

Try

Result

You enteredFF16→binary, octal, decimal, hex\mathrm{FF}_{16} \to \text{binary, octal, decimal, hex}

111111112, 3778, 25510, FF16\displaystyle \mathrm{11111111}_{2},\ \mathrm{377}_{8},\ \mathrm{255}_{10},\ \mathrm{FF}_{16}

Binary

111111112\displaystyle \mathrm{11111111}_{2}

Octal

3778\displaystyle \mathrm{377}_{8}

Decimal

25510\displaystyle \mathrm{255}_{10}

Hex

FF16\displaystyle \mathrm{FF}_{16}
Show the work
  1. Positional notation

    Each digit is worth its value times a power of the base b=16b = 16, counting from 00 at the right. Adding the terms gives the number in decimal.

    Using N=dk bk+⋯+d1 b+d0N = d_{k}\,b^{k} + \cdots + d_{1}\,b + d_{0}

    FF16=15×161+15×160=240+15=255\begin{aligned} \mathrm{FF}_{16} &= 15 \times 16^{1} + 15 \times 16^{0} \\ &= 240 + 15 \\ &= 255 \end{aligned}
  2. Repeated division by 2

    To write a decimal number in binary, divide by the base b=2b = 2 again and again, keeping each remainder rr, until the quotient qq is 00. Read the remainders from the last to the first.

    Using N=b×q+r,0≤r<bN = b \times q + r, \quad 0 \le r < b

    255=2×127+1127=2×63+163=2×31+131=2×15+115=2×7+17=2×3+13=2×1+11=2×0+1\begin{array}{l} 255 = 2 \times 127 + 1 \\ 127 = 2 \times 63 + 1 \\ 63 = 2 \times 31 + 1 \\ 31 = 2 \times 15 + 1 \\ 15 = 2 \times 7 + 1 \\ 7 = 2 \times 3 + 1 \\ 3 = 2 \times 1 + 1 \\ 1 = 2 \times 0 + 1 \end{array}
  3. Repeated division by 8

    To write a decimal number in octal, divide by the base b=8b = 8 again and again, keeping each remainder rr, until the quotient qq is 00. Read the remainders from the last to the first.

    Using N=b×q+r,0≤r<bN = b \times q + r, \quad 0 \le r < b

    255=8×31+731=8×3+73=8×0+3\begin{array}{l} 255 = 8 \times 31 + 7 \\ 31 = 8 \times 3 + 7 \\ 3 = 8 \times 0 + 3 \end{array}
  4. Result

    So FF16\mathrm{FF}_{16} is 111111112\mathrm{11111111}_{2} in binary, 3778\mathrm{377}_{8} in octal, 25510\mathrm{255}_{10} in decimal and FF16\mathrm{FF}_{16} in hex.

Worked examples