Number Base Conversion Calculator

Type a number, its base and the base you want to see it in.

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 entered25510→binary, octal, decimal, hex\mathrm{255}_{10} \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. 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}
  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

    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}
  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

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

    So 25510\mathrm{255}_{10} 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