How base conversion works
In a positional number system, each digit is multiplied by the base raised to the power of its position. To convert into decimal, add up those values. To convert out of decimal, divide repeatedly by the new base and collect the remainders.
Quick reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 5 | 101 | 5 | 5 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
Prefixes 0b (binary), 0o (octal) and 0x (hex) are accepted and ignored. Underscores and spaces used as digit separators are removed.
How to use the converter
- Type a number in any field — decimal, binary, octal or hexadecimal.
- The other bases update instantly. Hexadecimal accepts digits 0–9 and letters A–F in upper or lower case.
- Use the custom base field for any base from 2 to 36.
Converting decimal to binary by hand
Repeatedly divide by 2 and record the remainders, then read them from bottom to top:
The same method works for any base: divide by 8 for octal or by 16 for hexadecimal, using A–F for remainders 10–15.
Binary ↔ hexadecimal shortcut
Each hexadecimal digit corresponds to exactly four binary digits (bits), so you can convert by grouping bits from the right: 1011 0110₂ = B6₁₆. Octal works the same way with groups of three bits. That’s why programmers use hex as a compact way to write binary data — one byte (8 bits) is always two hex digits, from 00 to FF.
- 0000 = 0 · 0001 = 1 · 0010 = 2 · 0011 = 3 · 0100 = 4 · 0101 = 5 · 0110 = 6 · 0111 = 7
- 1000 = 8 · 1001 = 9 · 1010 = A · 1011 = B · 1100 = C · 1101 = D · 1110 = E · 1111 = F
Where each base is used
- Binary (base 2): how computers store everything — bits, network subnet masks, bit flags.
- Octal (base 8): Unix file permissions, such as chmod 755 (rwx r-x r-x).
- Hexadecimal (base 16): web colors (#FF8800), memory addresses, MAC addresses, Unicode code points (U+00E9) and hashes.
- Base 36: short IDs and URL shorteners, since it uses all digits and letters.
In code, prefixes mark the base: 0b101101 (binary), 0o55 (octal) and 0x2D (hex) all equal 45 in decimal.