Binary to Hex Converter
The binary to hex converter groups the bits in fours from the right and turns each group into one hex digit: 1010 1010 = AA. It also converts hex back to binary, four bits for every digit.
Sources: Wikipedia Updated
Binary to hex
Hex to binary
How the binary and hex conversion works
• Binary to Hex: Groups binary digits into sets of 4 bits (nibbles) and converts each nibble directly to its hexadecimal equivalent
• Hex to Binary: Converts each hexadecimal digit directly to its 4-bit binary representation
• Supports common hex formats: with or without '0x' prefix
How binary to hex conversion works
Binary to hex is a grouping shortcut that never goes through decimal. Since 16 is 2⁴, every group of four bits, called a nibble, matches exactly one hex digit.
The converter pads your input with zeros on the left until its length is a multiple of 4, splits it into nibbles and looks up each one. That is why a byte is always two hex digits.
How to convert binary to hex
- Group the bits in fours from the right: 10101010 becomes 1010 1010. Pad the leftmost group with zeros if it is short.
- Turn each group into its value with the place values 8, 4, 2, 1: 1010 = 8 + 2 = 10.
- Write each value as a hex digit: 10 is A, so 1010 1010 = AA.
Check through decimal: 10101010 is 170 in the binary to decimal converter, and 170 = 10 × 16 + 10, which is AA. The result matches.
Hex to binary: four bits per digit
The reverse writes each hex digit as four bits. AA becomes 1010 and 1010, so 10101010 again. The separate hex to binary converter works through a longer example, 1A3F.
Binary to hex chart
| Bits | Hex | Bits | Hex | Bits | Hex | Bits | Hex |
|---|---|---|---|---|---|---|---|
| 0000 | 0 | 0100 | 4 | 1000 | 8 | 1100 | C |
| 0001 | 1 | 0101 | 5 | 1001 | 9 | 1101 | D |
| 0010 | 2 | 0110 | 6 | 1010 | A | 1110 | E |
| 0011 | 3 | 0111 | 7 | 1011 | B | 1111 | F |
Input rules
The binary box accepts only 0 and 1. The hex box accepts 0 to 9 and A to F in either case, and it strips an optional 0x prefix. Leading zeros are trimmed from the binary result unless the whole answer is 0.
Where hex stands in for binary
Hex is the short way to write groups of bits: memory addresses, register dumps and colour codes. #FF0000 is three bytes, red 255, green 0 and blue 0, each written as two hex digits.
Octal does the same with groups of three bits; see the binary to octal converter. Every conversion is listed on the number system converters page.
Binary to Hex Converter: FAQ
Why does binary convert to hex in groups of four?
Because 16 = 2⁴. Four bits have exactly 16 patterns, 0000 to 1111, and hexadecimal has exactly 16 digits, 0 to F.
What is 11111111 in hex?
FF. Each group 1111 is 15, the hex digit F. In decimal it is 255.
What if the number of bits is not a multiple of four?
Add zeros on the left until it is. 111010110 has 9 bits, so it becomes 0001 1101 0110, which is 1D6.
Sources
- Wikipedia: Hexadecimal — a hex digit stands for 4 bits, and a byte is two hex digits (checked October 16, 2026)
- Wikipedia: Nibble — a group of four bits (checked October 16, 2026)