Skip to content

Number base converter

Binary, octal, decimal, hexadecimal — and every base from 2 to 36 at the same time.

Paste 0xFF, 0b1010 or 0o755 and the base is picked up automatically. Underscores, spaces and commas are ignored.

Display options

Integer part is 8 bits wide.

  • Binary2
    11111111
  • Octal8
    377
  • Decimal10
    255
  • Hexadecimal16
    ff

Why the width doesn’t matter here

JavaScript numbers carry 53 bits of precision, so the usual way to write this tool —parseInt(value, 16) — is silently wrong on exactly the values people most often convert. A 64-bit hash entered asFFFFFFFFFFFFFFFF comes back as 18446744073709552000 instead of 18446744073709551615: right length, wrong digits, no error.

This page holds integers as arbitrary-precision values and fractions as exact ratios, so nothing is ever routed through a floating-point number. There is no width limit, and a fraction whose expansion doesn’t terminate in the target base — 0.1 decimal in binary, say — is marked approx. rather than quietly truncated.

Common conversions

Try one

esc