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 entered10102→binary, octal, decimal, hex\mathrm{1010}_{2} \to \text{binary, octal, decimal, hex}

10102, 128, 1010, A16\displaystyle \mathrm{1010}_{2},\ \mathrm{12}_{8},\ \mathrm{10}_{10},\ \mathrm{A}_{16}

Binary

10102\displaystyle \mathrm{1010}_{2}

Octal

128\displaystyle \mathrm{12}_{8}

Decimal

1010\displaystyle \mathrm{10}_{10}

Hex

A16\displaystyle \mathrm{A}_{16}
Show the work
  1. Positional notation

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

    10102=1×23+0×22+1×21+0×20=8+0+2+0=10\begin{aligned} \mathrm{1010}_{2} &= 1 \times 2^{3} + 0 \times 2^{2} + 1 \times 2^{1} + 0 \times 2^{0} \\ &= 8 + 0 + 2 + 0 \\ &= 10 \end{aligned}
  2. 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

    10=8×1+21=8×0+1\begin{array}{l} 10 = 8 \times 1 + 2 \\ 1 = 8 \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

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

    So 10102\mathrm{1010}_{2} is 10102\mathrm{1010}_{2} in binary, 128\mathrm{12}_{8} in octal, 1010\mathrm{10}_{10} in decimal and A16\mathrm{A}_{16} in hex.

Worked examples