Number base converter

Binary, octal, decimal, hex and any base from 2 to 36, with bit toggles.

Binary
0b11111111

base 2

Octal
0o377

base 8

Decimal
255

base 10

Hexadecimal
0xFF

base 16

Base 36
73

32-bit view

Click any bit to flip it.

bit 31bit 0

How it works

A number base is just how many digits you count with before rolling over. Decimal uses ten (0–9); binary uses two; hexadecimal uses sixteen, borrowing A–F for the values ten to fifteen. The value never changes — 255, 0xFF and 0b11111111 are the same quantity written three ways.

value = Σ digit(i) × base^i

Why hexadecimal shows up everywhere in computing

One hex digit is exactly four bits, so a byte is always exactly two hex digits. That makes hex a compact, lossless shorthand for binary — which is why colors (#FF8800), memory addresses and hashes are written that way.

Fractions

Fractional values are supported and shown to twelve digits. Note that a fraction which terminates in one base may repeat forever in another — 0.1 in decimal is a repeating binary fraction, which is the root cause of floating-point surprises.