Number Base Converter

Type a whole number, choose the base it is written in and the base you want. Works with numbers of any size, and shows the place-value or repeated-division working.

Convert between bases

Digits 0–9 and A–Z. Prefixes 0b, 0o and 0x are accepted; spaces and underscores are ignored.

In base 21111 1111
Octal (base 8)
377
Hexadecimal (base 16)
FF

Working

  1. 255 ÷ 2 = 127 remainder 1
  2. 127 ÷ 2 = 63 remainder 1
  3. 63 ÷ 2 = 31 remainder 1
  4. 31 ÷ 2 = 15 remainder 1
  5. 15 ÷ 2 = 7 remainder 1
  6. 7 ÷ 2 = 3 remainder 1
  7. 3 ÷ 2 = 1 remainder 1
  8. 1 ÷ 2 = 0 remainder 1
  9. Read the remainders from bottom to top: 11111111

How number bases work

In base 10 each place is worth ten times the place to its right: 255 = 2 × 100 + 5 × 10 + 5 × 1. Any other base works the same way with a different multiplier. In binary (base 2) the places are 1, 2, 4, 8, 16…, so 11111111₂ = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Hexadecimal (base 16) uses the digits 0–9 and A–F for ten to fifteen, so FF₁₆ = 15 × 16 + 15 = 255.

Decimal to another base: repeated division

Convert 156 to binary

  1. 156 ÷ 2 = 78 r 0
  2. 78 ÷ 2 = 39 r 0
  3. 39 ÷ 2 = 19 r 1
  4. 19 ÷ 2 = 9 r 1
  5. 9 ÷ 2 = 4 r 1
  6. 4 ÷ 2 = 2 r 0
  7. 2 ÷ 2 = 1 r 0
  8. 1 ÷ 2 = 0 r 1
  9. Read the remainders from the bottom up

156₁₀ = 10011100₂

Binary ↔ hex shortcut

Every hex digit is exactly four binary digits, so you can convert by grouping: 1001 1100₂ → 9 and C → 9C₁₆. Octal digits are groups of three bits. That is why programmers use hex to write bytes compactly: one byte is two hex digits (00 to FF).

Limits

  • Whole numbers only — fractional parts are not converted.
  • Negative numbers are shown with a minus sign; two’s-complement representations depend on the word size, so they are not guessed.
  • Inputs can be up to 256 digits long; arithmetic uses exact big integers, so there is no rounding.