Convert Hexadecimal to Binary
Convert hexadecimal to binary by expanding each hex digit into 4 bits. Includes the full nibble mapping table and practical conversion examples for developers.
Detailed Explanation
Converting hexadecimal to binary is the inverse of binary-to-hex and is just as straightforward. Each hex digit expands to exactly 4 binary bits, making the process purely mechanical.
Step-by-step example — converting 0xA7E2 to binary:
- Take each hex digit individually:
A,7,E,2 - Convert each to its 4-bit binary equivalent:
A = 10107 = 0111E = 11102 = 0010
- Concatenate:
1010 0111 1110 0010
So 0xA7E2 = 1010011111100010₂.
Why hex-to-binary is so direct:
The beauty of hexadecimal is that it was designed as a shorthand for binary. Since 16 = 2⁴, every hex digit maps to a unique 4-bit pattern. There is no arithmetic involved — just a simple lookup. This is why hex became the universal standard for displaying binary data in computing.
Practical applications:
- Reading machine code: Disassemblers show instructions in hex. Converting to binary lets you see individual opcode bits and addressing modes.
- Analyzing network packets: Protocol fields are shown in hex in tools like Wireshark. Converting to binary reveals individual flag bits.
- Understanding permissions: Unix file permissions in hex (like
0x1FF) become clear when viewed as binary (111111111), showing read/write/execute bits. - Color manipulation: Hex color
#FF8040becomes11111111 10000000 01000000in binary, which helps when performing bitwise color operations.
Tips for speed:
Memorize the binary equivalents for hex digits 0-F. Focus especially on 0=0000, 5=0101, A=1010, and F=1111, as these appear most frequently. With practice, you can convert a 32-bit hex value to binary in seconds by mentally expanding each digit.
Use Case
Security researchers expand hex-encoded shellcode into binary to analyze individual instruction bits and identify exploit techniques in malware samples.
Try It — Number Base Converter
Related Topics
Convert Binary to Hexadecimal
Binary (Base 2) → Hexadecimal (Base 16)
Convert Hexadecimal to Decimal
Hexadecimal (Base 16) → Decimal (Base 10)
Understanding Hex Color Codes in CSS and Design
Visual Color → Hexadecimal (Base 16)
How to Read a Hexdump
Raw Binary Data → Hexadecimal + ASCII
Convert Binary to Decimal
Binary (Base 2) → Decimal (Base 10)