TFT

Hexadecimal to Binary Converter

Convert hexadecimal numbers to binary code. This tool expands each hex digit into its 4-bit binary representation. Essential for programmers working with memory dumps, color codes, or machine-level data.

Hexadecimal to Binary Reference Table

Hex
Binary
Hex
Binary
0
0000
8
1000
1
0001
9
1001
2
0010
A
1010
3
0011
B
1011
4
0100
C
1100
5
0101
D
1101
6
0110
E
1110
7
0111
F
1111

How Hexadecimal to Binary Conversion Works

Each hexadecimal digit (0-9, A-F) maps directly to a 4-bit binary number. Simply replace each hex digit with its 4-bit binary equivalent. For example: DA = D(1101) A(1010) = 11011010 in binary.

How It Works

This hexadecimal to binary converter transforms hex numbers (base-16) into binary code (base-2). Each hexadecimal digit (0-9, A-F) maps directly to exactly 4 binary bits, making conversion straightforward and efficient.

The conversion process:

  1. Validate input: Ensure input contains only valid hex digits (0-9, A-F, case-insensitive).
  2. Map each digit: Convert each hex digit to its 4-bit binary equivalent (0=0000, F=1111).
  3. Concatenate bits: Join all 4-bit groups to form the complete binary string.
  4. Optional padding: Add leading zeros to maintain byte alignment if needed.

For example: 2A becomes 0010 1010 (2=0010, A=1010). This direct mapping makes hex a convenient shorthand for binary, widely used in computing.

When You'd Actually Use This

Memory Address Analysis

Convert memory addresses from hex to binary to understand bit-level addressing and alignment.

Color Code Conversion

Translate hex color codes (#FF5733) to binary for understanding RGB component bits.

Machine Code Study

Convert hexadecimal opcodes to binary to understand CPU instruction encoding.

Network Protocol Analysis

Translate hex packet captures to binary for bit-level protocol analysis.

MAC Address Conversion

Convert MAC addresses from hex to binary for understanding network addressing.

Learning Number Systems

Understand the relationship between hexadecimal and binary for computer science education.

What to Know Before Using

Each hex digit = 4 binary bits

This is the key relationship. Hex is essentially a compact representation of binary, with 4 bits per digit.

Leading zeros may be significant

0x0A and 0xA are the same value, but in binary context, leading zeros may indicate byte alignment.

Case doesn't matter for hex

A-F and a-f are equivalent. 2A and 2a both convert to 00101010.

0x prefix is optional

Some notations use 0x to indicate hex (0x2A). The converter handles with or without prefix.

Output length is predictable

N hex digits always produce 4×N binary bits. 8 hex digits = 32 bits = 4 bytes.

Common Questions

Why use hexadecimal instead of binary?

Hex is more compact and readable. One byte (8 bits) becomes 2 hex digits instead of 8 binary digits. Easier for humans to work with.

What's the binary for hex digit F?

F = 1111 (the maximum 4-bit value). Hex digits 0-F map to binary 0000-1111.

How do I convert binary back to hex?

Group binary into 4-bit nibbles, then convert each to hex. 11010110 becomes D6 (1101=D, 0110=6).

Can hex represent negative numbers?

Yes, using two's complement notation. 0xFF in 8-bit is -1. The binary representation is the same; interpretation differs.

What's the hex to binary table?

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.

Why is hex used for memory addresses?

Memory addresses are binary numbers. Hex provides a compact, readable representation. 0x7FFF0000 is easier than 32 binary digits.

Do I need to pad the binary output?

Depends on your use case. For byte alignment, ensure output is divisible by 8. Some tools auto-pad to maintain alignment.