Binary ↔ Hexadecimal Converter
Convert between binary (base-2) and hexadecimal (base-16) number systems
How to Convert Between Binary and Hexadecimal
Binary to Hex
- Group binary digits into sets of four (starting from right)
- Convert each 4-bit group to its hex equivalent
- Combine hex digits for final result
Hex to Binary
- Convert each hex digit to 4 binary digits
- Combine all binary digits
- Remove leading zeros if needed
Binary-Hexadecimal Conversion Table
Binary | Hexadecimal | Binary | Hexadecimal |
---|
0000 | 0 | 1000 | 8 |
0001 | 1 | 1001 | 9 |
0010 | 2 | 1010 | A |
0011 | 3 | 1011 | B |
0100 | 4 | 1100 | C |
0101 | 5 | 1101 | D |
0110 | 6 | 1110 | E |
0111 | 7 | 1111 | F |
Practical Examples
Binary to Hex Example
11010110 → 1101 0110 → D 6 → D6
Hex to Binary Example
A7 → A (1010) 7 (0111) → 10100111
Why Use Hexadecimal?
- More compact than binary (1 hex digit = 4 binary digits)
- Easier to read and less error-prone than long binary strings
- Directly maps to bytes in computing (2 hex digits = 1 byte)
- Widely used in memory addressing and color codes
Common Applications
- Computer memory addressing
- Assembly language programming
- Network protocol analysis
- Digital electronics debugging
- Web color codes (e.g., #FF5733)
- File formats and binary data inspection