Convert between Binary, Decimal, Hexadecimal, and Octal
Click on bits to toggle them!
Binary is a base-2 number system using only two digits:
0 - OFF / False / No1 - ON / True / YesComputers use binary because electronic circuits can easily represent two states (on/off).
Each position represents a power of 2 (right to left):
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Power of 2 | 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 × 16 = 16
0 × 8 = 0
1 × 4 = 4
1 × 2 = 2
0 × 1 = 0
Total: 16 + 4 + 2 = 22
| 0 | = | 0000 |
| 1 | = | 0001 |
| 5 | = | 0101 |
| 10 | = | 1010 |
| 15 | = | 1111 |
| 255 | = | 11111111 |
Uses 16 symbols: 0-9 and A-F
A=10, B=11, C=12, D=13, E=14, F=15
Uses 8 symbols: 0-7
No 8 or 9 in octal!
Each hex digit converts to exactly 4 binary digits:
| Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| Binary | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 |
| Hex | 8 | 9 | A | B | C | D | E | F |
| Binary | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
25 ÷ 2 = 12 remainder 1
12 ÷ 2 = 6 remainder 0
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read bottom to top: 11001