Hexadecimal to Binary Converter
Convert hexadecimal (base-16) numbers to binary (base-2) format for bit manipulation, hardware programming, network protocols, and low-level system operations
Conversion Options
Hex to Binary mapping:
0→0000, 1→0001, 2→0010, 3→0011
4→0100, 5→0101, 6→0110, 7→0111
8→1000, 9→1001, A→1010, B→1011
C→1100, D→1101, E→1110, F→1111
Example: 0xFF → 0b11111111
Recommended Settings
Pro Tips
- •Each hexadecimal digit converts to exactly 4 binary digits (nibble)
- •Hexadecimal is more compact: 0xFF = 11111111 (2 hex digits = 8 binary digits)
- •Common in memory dumps, color codes (#FFFFFF), MAC addresses, and IPv6
- •Use grouping by 4 bits to see hex digit boundaries, or 8 bits to see bytes
Most Popular
Most users enable byte padding and 4-bit grouping to visualize hex structure
When to Use This Tool
Convert hexadecimal masks and bit patterns to binary for understanding bitwise AND, OR, XOR, and shift operations. Essential for low-level programming, embedded systems, and hardware control where you need to see individual bit positions. Example: 0xF0 (11110000) masks the upper 4 bits.
Decode hexadecimal packet dumps from Wireshark, tcpdump, and network analyzers to binary format for bit-level protocol analysis. View TCP flags, IP headers, and MAC addresses in binary to understand individual control bits. Critical for network troubleshooting, security analysis, and protocol implementation.
Convert hexadecimal register values and configuration data to binary for microcontroller programming, FPGA development, and hardware design. Verify bit settings in control registers, status flags, and peripheral configurations. Essential for ARM, AVR, PIC programming and hardware debugging with logic analyzers.
Visualize hexadecimal instruction opcodes, memory addresses, and data values as binary for computer architecture education and assembly programming. Understand instruction encoding, addressing modes, and data representation. Useful for reverse engineering, CPU simulation, and learning how computers work at the bit level.
How It Works
Parse input hexadecimal strings (with or without 0x prefix)
Remove 0x prefix if present and removePrefix option is enabled
Validate hex string contains only valid characters (0-9, A-F, case-insensitive)
Convert each hex digit to its 4-bit binary equivalent using lookup
Concatenate all 4-bit groups to form complete binary representation
Remove leading zeros unless padToByte is enabled
If padToByte enabled, pad to nearest 8-bit boundary (full byte)
If groupDigits enabled, split into groups of 4 or 8 bits with spaces
Add 0b prefix if enabled for binary literal notation
100% Private
Files never leave your device. All processing happens locally in your browser.
Lightning Fast
Powered by Pure JavaScript for optimal performance on modern browsers.
Secure
No data collection, no tracking, no sign-up required.
Frequently Asked Questions
Why does each hex digit become 4 binary digits?
Hexadecimal is base-16, and 16 = 2⁴. Each hex digit (0-F) represents a value from 0-15, which requires exactly 4 bits to represent in binary. This perfect alignment makes hex-to-binary conversion straightforward: 0=0000, 1=0001, ..., F=1111. Two hex digits = 8 bits = 1 byte, which is why hex is commonly used in computing.
What's the difference between padded and unpadded output?
Unpadded output removes leading zeros: 0x0F → 1111 (4 bits). Padded output preserves byte boundaries: 0x0F → 00001111 (8 bits). Padding is important when working with fixed-width data like bytes, registers, or network packets where bit positions matter. Unpadded is more compact but loses information about the original data width.
When should I group digits by 4 vs 8 bits?
Group by 4 bits (nibbles) to see the hex structure clearly: each group corresponds to one hex digit (0xAB = 1010 1011). Group by 8 bits (bytes) to see byte boundaries, which is standard in memory dumps and network packets (0xABCD = 10101011 11001101). Choose based on whether you're analyzing hex digits or bytes.
Why is hexadecimal used instead of binary in practice?
Hexadecimal is more compact and human-readable while maintaining direct binary correspondence. 0xFF is easier to read/write than 11111111, yet each hex digit maps to exactly 4 bits. This makes hex ideal for: memory addresses (0x1000), color codes (#FF0000), MAC addresses (AA:BB:CC:DD:EE:FF), and debugging. You get compactness without losing the bit-level precision of binary.
How do I convert hex color codes to binary RGB values?
Hex color codes use 6 hex digits (3 bytes) for RGB. Example: #FF8000 → separate into FF (red), 80 (green), 00 (blue) → convert each: FF=11111111 (255), 80=10000000 (128), 00=00000000 (0). This tool converts them all at once if you input them separately, or you can input the full 6-digit hex and group by 8 bits to see each color channel.
What does the 0b prefix mean in binary output?
The 0b prefix is the standard notation for binary literals in many programming languages (Python, C++, JavaScript, etc.). It explicitly indicates the number is in binary: 0b11111111 = 255 in decimal. Just like 0x indicates hexadecimal, 0b indicates binary. This prevents ambiguity and makes the code self-documenting when working with different number bases.