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 entered178→binary, octal, decimal, hex\mathrm{17}_{8} \to \text{binary, octal, decimal, hex}

11112, 178, 1510, F16\displaystyle \mathrm{1111}_{2},\ \mathrm{17}_{8},\ \mathrm{15}_{10},\ \mathrm{F}_{16}

Binary

11112\displaystyle \mathrm{1111}_{2}

Octal

178\displaystyle \mathrm{17}_{8}

Decimal

1510\displaystyle \mathrm{15}_{10}

Hex

F16\displaystyle \mathrm{F}_{16}
Show the work
  1. Positional notation

    Each digit is worth its value times a power of the base b=8b = 8, 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}

    178=1×81+7×80=8+7=15\begin{aligned} \mathrm{17}_{8} &= 1 \times 8^{1} + 7 \times 8^{0} \\ &= 8 + 7 \\ &= 15 \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

    15=2×7+17=2×3+13=2×1+11=2×0+1\begin{array}{l} 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 16

    To write a decimal number in hexadecimal, divide by the base b=16b = 16 again and again, keeping each remainder rr, until the quotient qq is 00. Read the remainders from the last to the first, with 10 and up written as letters.

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

    15=16×0+15(15→F)\begin{array}{l} 15 = 16 \times 0 + 15 \quad \left(15 \to \mathrm{F}\right) \end{array}
  4. Result

    So 178\mathrm{17}_{8} is 11112\mathrm{1111}_{2} in binary, 178\mathrm{17}_{8} in octal, 1510\mathrm{15}_{10} in decimal and F16\mathrm{F}_{16} in hex.

Worked examples