Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Hexadecimal (base 16)
D6
0xD6
Binary input 11010110
Decimal value 214
Number of bits 8

What is a Binary to Hex Converter?

This tool converts a number written in binary (base 2, digits 0 and 1) into hexadecimal (base 16, digits 0-9 and A-F). Hex is widely used in programming, memory addresses, color codes and debugging because it represents binary data far more compactly — every group of four binary bits becomes exactly one hex digit.

How to use it

Type or paste a binary number such as 11010110 into the input box and submit. Any spaces or stray characters are ignored, so 1101 0110 works too. The result shows the hexadecimal value, the equivalent decimal value, and the bit count.

The formula explained

The conversion relies on the fact that \(16 = 2^4\). The algorithm pads the binary string on the left with zeros until its length is a multiple of 4, then splits it into 4-bit groups called nibbles, working from the right. Each nibble is a value from 0 to 15, computed as

$$8\cdot b_3 + 4\cdot b_2 + 2\cdot b_1 + b_0$$

and that value maps to a single hex digit (0-9 then A-F). Concatenating the digits gives the hexadecimal result. The full conversion can be written as

$$\text{Hex}_{16} = \sum_{i=0}^{n-1} d_i \cdot 16^{i}, \quad d_i \in \{0\text{–}9,\,A\text{–}F\} \;\leftarrow\; \text{Binary (base 2)}$$
Binary digits grouped into nibbles each mapping to one hex digit
Each group of four bits (a nibble) maps to a single hexadecimal digit.

Worked example

Take 11010110. Split into nibbles: 1101 and 0110. The first equals \(8+4+0+1 = 13 = D\). The second equals \(0+4+2+0 = 6\). So the hex result is D6, which is 214 in decimal.

Binary Nibble to Hex Digit Lookup Table

The fastest way to convert binary to hexadecimal is to split the bits into groups of four (called nibbles) and replace each nibble with a single hex digit. Because \(2^4 = 16\), every 4-bit pattern maps to exactly one of the 16 hex digits. Memorizing or referencing the table below lets you convert any binary number nibble by nibble, with no division required.

4-bit Binary (nibble) Decimal (base 10) Hex Digit (base 16)
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 10 A
1011 11 B
1100 12 C
1101 13 D
1110 14 E
1111 15 F

Worked example: the byte 11010110 splits into 1101 and 0110. From the table these map to D and 6, giving the hex value D6, which equals decimal 214. If a binary number's length is not a multiple of 4, pad the left side with leading zeros before grouping (for example, 101101 becomes 0010 11012D).

Key Terms

Bit
The smallest unit of digital information, holding a single binary value of either 0 or 1. The word is a contraction of “binary digit.”
Nibble
A group of four bits. Because four bits represent \(2^4 = 16\) possible values, one nibble corresponds to exactly one hexadecimal digit — which is what makes binary-to-hex conversion so direct.
Byte
A group of eight bits (two nibbles). One byte holds \(2^8 = 256\) possible values and is written as exactly two hex digits, e.g. 11111111 = FF = 255.
Base / Radix
The number of distinct digit symbols a positional number system uses, and the multiplier between place values. Binary is base 2, decimal is base 10, and hexadecimal is base 16. In base \(b\), the digit in position \(i\) (counting from 0 on the right) carries the weight \(b^{i}\).
Binary (base 2)
A number system using only the digits 0 and 1, where each position is worth a power of two. It mirrors the on/off states of digital electronics, making it the native language of computers.
Decimal (base 10)
The everyday number system using digits 0 through 9, where each position is worth a power of ten. It serves as the common reference point when comparing binary and hex values.
Hexadecimal (base 16)
A number system using sixteen digits: 0–9 followed by A–F (where A=10, B=11, C=12, D=13, E=14, F=15). Its compactness — one hex digit per nibble — makes long binary strings far easier for humans to read and write.
MSB / LSB
The Most Significant Bit is the leftmost bit, carrying the largest place value (the highest power of two). The Least Significant Bit is the rightmost bit, carrying the smallest value (\(2^0 = 1\)). The same “most/least significant” idea applies to whole digits in hex.
0x Prefix
A conventional marker, written before a number, indicating that the value is expressed in hexadecimal — for example 0xD6 means the hex value D6 (decimal 214), not the digits “D6” in some other base. It is widely used in programming languages such as C, Java, and Python. Binary is often similarly prefixed with 0b.

FAQ

What if the bits don't divide evenly by 4? The converter pads zeros on the left automatically, so 1010110 becomes 0101 0110 = 56.

Does it handle leading zeros? Yes — leading zeros are stripped from the final hex output, but they do not change the value.

Is the output uppercase? Hex digits A-F are shown in uppercase by convention, and prefixed with 0x for clarity.

Last updated: