Type a number above to see the conversion steps.
Quick Reference: 0–15 in All Bases
| Decimal | Binary | Octal | Hex |
|---|
How Number Base Conversion Works
Every number system is built on a base — the number of unique digit symbols used. Our everyday decimal system uses base 10 (digits 0–9). Computers natively use binary (base 2, digits 0–1). Programmers often work with octal (base 8) and hexadecimal (base 16) as compact shorthands for binary data.
Binary to Decimal
Each binary digit (bit) represents a power of 2 based on its position, counting right to left from position 0. Multiply each bit by its positional value and sum:
Decimal to Binary (Long Division)
Repeatedly divide the decimal number by 2, recording each remainder. Read the remainders bottom-to-top for the binary result:
Hexadecimal
Hex uses 16 symbols: 0–9 and A–F (A=10, B=11, C=12, D=13, E=14, F=15). One hex digit compactly represents exactly 4 binary bits. Two hex digits represent one byte. This makes hex ideal for memory addresses and color codes.
Why Octal?
Octal (base 8) was popular in early computing because 3 binary bits map to exactly one octal digit. It appears in Unix file permissions (chmod 755 = 111 101 101 in binary) and older programming contexts.
Two's Complement
Computers represent negative integers using two's complement. For an N-bit register: if the leading bit is 0, the value is positive (same as unsigned). If the leading bit is 1, the signed value equals the unsigned value minus 2N. For example, 8-bit 11111111 = 255 unsigned = −1 signed.
Two's Complement Interpreter
Enter an N-bit binary number to see both its unsigned and signed (two's complement) interpretations. Use the Bitwise View panel above to toggle individual bits and watch all values update live.
The table below shows common 8-bit two's complement values:
| Binary (8-bit) | Unsigned | Signed (Two's Comp.) |
|---|---|---|
| 0000 0000 | 0 | 0 |
| 0111 1111 | 127 | 127 (max positive) |
| 1000 0000 | 128 | −128 (min negative) |
| 1111 1111 | 255 | −1 |
| 1111 1110 | 254 | −2 |
| 1000 0001 | 129 | −127 |