Binary to Decimal Converter
Convert between binary, decimal, hexadecimal, and octal
Frequently Asked Questions
How number base conversion works
In a positional number system, each digit is multiplied by the base raised to the power of its position, counting from zero on the right. The converter reads your number in its base, turns it into a decimal value, and writes that value in binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16).
Examples
- Binary 1010 = 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal, A in hex.
- Hex FF = 15×16 + 15 = 255, which is 11111111 in binary.
- Decimal 100 = 1100100 in binary, 144 in octal and 64 in hex.
Converting decimal to another base by hand
Divide the number by the target base repeatedly and write down the remainders; read them from last to first. For 13 in binary: 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, so 13 = 1101.
Quick reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
Each hex digit corresponds to exactly four binary digits and each octal digit to three, which is why programmers use hex as a compact way to write binary.
Signed numbers and two's complement
With the signed option, the converter treats the highest bit of an 8, 16 or 32-bit value as the sign using two's complement, the format almost all computers use. In 8 bits, 11111011 is −5: invert the bits (00000100), add 1 (00000101) and apply a minus sign. The 8-bit signed range is −128 to 127; unsigned it is 0 to 255.
Where you see each base
- Hex: colors (#FF8800), memory addresses, MAC addresses.
- Octal: Unix file permissions such as 755.
- Binary: bit flags, subnet masks and low-level hardware.
For other conversions, see the unit converter, and for counting arrangements of bits or digits, the combination and permutation calculator.