Binary to Hex Calculator
Enter a binary number and instantly see it in hexadecimal, decimal, and octal — built for programming, digital logic, and low-level debugging.
Convert Binary to Hexadecimal
Enter a value in either field — the other updates instantly.
0xD6
Why Convert Binary to Hex?
Binary (base 2) is the native language of digital circuits, using only 0s and 1s to represent every value a computer stores or processes. Hexadecimal (base 16) is a compact way for humans to read and write those same values, since each hex digit represents exactly four binary digits (a "nibble"). Programmers, hardware engineers, and network administrators use hex constantly for memory addresses, color codes, MAC addresses, and byte-level data, because it's far more compact and readable than long strings of 1s and 0s.
Because 16 is a power of 2 (2⁴), converting between binary and hex is a clean, exact process with no rounding: every group of 4 binary digits maps to exactly one hex digit, and there's no ambiguity in either direction.
The Binary to Hex Method
Converting between binary and hex doesn't require going through decimal — it can be done directly by grouping bits.
Binary → Hex
Starting from the right, split the binary number into groups of 4 bits, padding the leftmost group with zeros if needed. Convert each group to its hex digit.
Example: 1101 0110 → D6
Hex → Binary
Convert each hex digit individually into its 4-bit binary equivalent, then concatenate the groups in order.
Example: A3 → 1010 0011
4-Bit Binary to Hex Conversion Table
Every possible 4-bit binary group and its corresponding hex digit — the building block for converting any binary number.
| Binary | Hex | Decimal | Binary | Hex | Decimal |
|---|---|---|---|---|---|
0000 | 0 | 0 | 1000 | 8 | 8 |
0001 | 1 | 1 | 1001 | 9 | 9 |
0010 | 2 | 2 | 1010 | A | 10 |
0011 | 3 | 3 | 1011 | B | 11 |
0100 | 4 | 4 | 1100 | C | 12 |
0101 | 5 | 5 | 1101 | D | 13 |
0110 | 6 | 6 | 1110 | E | 14 |
0111 | 7 | 7 | 1111 | F | 15 |
For a binary or hex value not listed here, the calculator at the top of this page computes the exact conversion instantly, no matter how many bits long.
Worked Examples: Step by Step
Example 1: Convert binary 101111010110 to hex
- Group into 4-bit chunks from the right: 1011 1101 0110
- Convert each group: 1011 = B, 1101 = D, 0110 = 6
- Answer:
101111010110=BD6
Example 2: Convert hex 2F to binary
- Convert each hex digit: 2 = 0010, F = 1111
- Concatenate: 0010 1111
- Answer:
2F=00101111
Example 3: Convert binary 11111111 (a full byte) to hex and decimal
- Group into 4-bit chunks: 1111 1111
- Convert each group: 1111 = F, 1111 = F
- Hex:
FF - Decimal check: FF = 15×16 + 15 = 255
- Answer:
11111111=FF= 255 in decimal, the maximum value of an unsigned byte
Where This Conversion Comes Up
Programming and Debugging
Memory addresses, pointer values, and error codes are almost always displayed in hex, while the underlying data being inspected is fundamentally binary, making this conversion routine when reading a debugger or memory dump.
Web Design and Color Codes
CSS and design tools use 6-digit hex codes like #FF5733 to represent colors, where each pair of hex digits corresponds to an 8-bit binary value for red, green, or blue.
Networking
MAC addresses and IPv6 addresses are written in hexadecimal, but network hardware and protocols operate on the underlying binary representation of that same data.
Digital Logic and Embedded Systems
Microcontroller registers, flags, and memory-mapped I/O are manipulated at the binary level but are almost always documented and displayed in hex for readability.
File Formats and Data Encoding
Hex editors display raw binary file contents as hexadecimal so that bytes can be read and edited without working through long strings of 1s and 0s.
Common Mistakes When Converting
- Grouping bits from the wrong end. Binary digits must be grouped into 4s starting from the rightmost (least significant) bit; grouping from the left can misalign the chunks on numbers whose bit length isn't a multiple of 4.
- Forgetting to zero-pad the leftmost group. A binary number like
101must be padded to0101before converting, since a 4-bit group is required for each hex digit. - Mixing up hex letters and digits. Hex uses A–F for the values 10–15; writing "10" instead of "A" or forgetting that hex is case-insensitive (both "a" and "A" are valid) leads to parsing errors.
- Assuming hex digit count always halves the binary digit count exactly. This is only true when the binary length is a multiple of 4 — otherwise, leading zero-padding is needed first to get a clean conversion.
Related Number Base Conversions Worth Knowing
Hex to Binary
Convert each hex digit to its 4-bit binary form. So 9 hex = 1001 binary.
Binary to Decimal
Sum each bit times its power of 2. So 1011 = 8+0+2+1 = 11.
Hex to Decimal
Sum each digit times its power of 16. So 1F = 1×16 + 15 = 31.
Binary to Octal
Group bits into 3s instead of 4s. So 101010 = 52 in octal.
Cheat Sheet: Common Byte Values
| Binary | Hex | Decimal |
|---|---|---|
00000000 | 00 | 0 |
00001111 | 0F | 15 |
01111111 | 7F | 127 |
10000000 | 80 | 128 |
11111111 | FF | 255 |
Frequently Asked Questions
How do I convert binary to hex?
Group the binary digits into sets of 4 starting from the right, padding the leftmost group with zeros if needed, then convert each group to its corresponding hex digit. For example, 1110 becomes E.
How do I convert hex to binary?
Convert each hex digit individually into its 4-bit binary equivalent, then join the groups together in order. For example, 3B becomes 00111011.
Why does hex use the letters A through F?
Hexadecimal is base 16, which needs 16 distinct digit symbols. After 0–9 are used up, the letters A–F represent the remaining values 10 through 15.
What is binary 11001010 in hex?
Grouping into 4s gives 1100 and 1010, which convert to C and A, so 11001010 = CA in hex.
Do I need to convert through decimal first?
No. Because 16 is a power of 2, binary and hex convert directly through 4-bit groupings without needing to pass through decimal, which is faster and less error-prone for large values.
Is hexadecimal case-sensitive?
No. Hex digits A through F can be written in uppercase or lowercase interchangeably; both represent the same values 10 through 15.
Does this calculator work in reverse, from hex to binary?
Yes. Enter a value into the Hexadecimal field and the Binary field updates automatically — the swap button lets you jump straight to entering hex instead.