Binary to Hexadecimal Converter
Converting binary to hexadecimal is straightforward once you grasp the grouping method. Binary numbers use base-2 (only 0s and 1s), whilst hexadecimal uses base-16 (0-9 and A-F). Each hexadecimal digit represents exactly four binary digits, making the conversion remarkably efficient for computer programming and digital systems.
Quick Convert Common Binary Values
Binary to Hex Conversion Table
This table shows the relationship between 4-bit binary patterns and their hexadecimal equivalents. Every hexadecimal digit corresponds to precisely four binary bits.
| Binary (4 bits) | Hexadecimal | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1011 | B | 11 |
| 1100 | C | 12 |
| 1101 | D | 13 |
| 1110 | E | 14 |
| 1111 | F | 15 |
How to Convert Binary to Hexadecimal
The direct method groups binary digits into sets of four and converts each group. This approach is far simpler than converting through decimal first.
Worked Examples
• Group into fours: 1101 0110
• Convert each group: 1101 = D, 0110 = 6
• Final result: D6
• Group into fours: 0010 1111 (padded left with zeros)
• Convert each group: 0010 = 2, 1111 = F
• Final result: 2F
• Group into fours: 1111 1111 1111 1111
• Convert each group: 1111 = F (four times)
• Final result: FFFF
Conversion Formula
Whilst there’s no single mathematical formula, the conversion principle relies on positional notation and grouping.
For manual conversions, remember that each binary position has a value: 8-4-2-1 from left to right within each group. Add up the values where you see a 1.
Number System Comparison
Binary (Base-2)
Uses only 0 and 1. Each position represents a power of 2. Long strings can be cumbersome for humans to read and write.
Hexadecimal (Base-16)
Uses 0-9 and A-F. Each position represents a power of 16. Compact representation ideal for computer memory addresses and colour codes.
Why Convert?
Programmers use hex because it’s more concise than binary but still maps directly to binary patterns. This makes debugging and reading machine code much easier.
Extended Conversion Table
Here are common 8-bit binary values (one byte) and their hexadecimal equivalents.
| Binary (8 bits) | Hexadecimal | Decimal |
|---|---|---|
| 00000000 | 00 | 0 |
| 00001111 | 0F | 15 |
| 00010000 | 10 | 16 |
| 00100000 | 20 | 32 |
| 01000000 | 40 | 64 |
| 01111111 | 7F | 127 |
| 10000000 | 80 | 128 |
| 10101010 | AA | 170 |
| 11000000 | C0 | 192 |
| 11110000 | F0 | 240 |
| 11111111 | FF | 255 |
Everyday Uses
Binary to hex conversion appears throughout computing and digital technology.
- Colour codes: Web colours like #FF5733 are hexadecimal representations of RGB values (red, green, blue). Each pair represents one colour channel in binary.
- MAC addresses: Network hardware identifiers use hex format (e.g., A4:5E:60:E7:9B:F2) because it’s more compact than binary.
- Memory addresses: Computer memory locations are typically shown in hexadecimal notation for readability.
- Error codes: System error codes often appear as hex values, making them easier to reference in technical documentation.
- File formats: Binary file headers and magic numbers are commonly expressed in hexadecimal for clarity.
Related Number System Conversions
| Conversion Type | Description | Difficulty |
|---|---|---|
| Hex to Binary | Reverse process – each hex digit becomes 4 binary bits | Simple |
| Binary to Decimal | Add up powers of 2 where bits are set to 1 | Moderate |
| Hex to Decimal | Multiply each digit by powers of 16 and sum | Moderate |
| Decimal to Binary | Repeatedly divide by 2 and record remainders | Moderate |
| Decimal to Hex | Repeatedly divide by 16 and record remainders | Moderate |
| Binary to Octal | Group binary digits in threes instead of fours | Simple |
