Hex to Binary

Encoders & Decoders

How to use the Hex to Binary

Convert hex to binary in two steps:

1

Enter the hex number

Type or paste any hex value using 0–9 and A–F (case-insensitive). The 0x prefix is optional.

2

Read the binary result

The binary output appears grouped in nibbles (4 bits per group). Decimal equivalent and bit length are shown in the panel below.


When to use this tool

Use to expand hex values into binary to inspect individual bits:

  • Expanding hex register values to binary to read individual flag bits or status bits in a hardware register
  • Converting hex protocol field values to binary to verify which bits are set in bitmask fields
  • Expanding hex memory addresses to binary to understand alignment and page boundary relationships
  • Converting hex color component values to binary to understand bit patterns in graphics or display hardware
  • Translating hex escape sequences in strings (\xAB) to binary to verify byte-level encoding
  • Expanding hex values from a network packet capture to binary to read flag fields and reserved bits in protocol headers

Frequently asked questions

Q:How does hex to binary conversion work?
Each hex digit expands directly to exactly 4 binary bits (a nibble), with no arithmetic needed. A=1010, B=1011, C=1100, D=1101, E=1110, F=1111, and digits 0–9 map to 0000–1001. Simply replace each hex digit with its 4-bit binary equivalent: 0xDE = 1101 1110, 0xAD = 1010 1101, 0xDEAD = 1101 1110 1010 1101. This direct mapping without intermediate decimal is why hex is often preferred over decimal for representing binary data.
Q:Why is the binary output grouped into nibbles?
Grouping binary output into 4-bit nibbles (e.g. '1101 1110' instead of '11011110') makes it much easier to read and cross-reference with hex. Each nibble corresponds to exactly one hex digit, so the nibble grouping creates a visual one-to-one alignment between the hex input and the binary output. This grouping also highlights byte boundaries — two nibbles make one byte (8 bits), and byte boundaries are important when reading protocol or register documentation.
Q:What is 0xFF in binary and why is it important?
0xFF in binary is 1111 1111 — eight 1-bits, all bits of a single byte set. It equals decimal 255 and is one of the most significant values in computing: the maximum unsigned byte, the maximum RGB channel value, the value of a full-byte bitmask, and each octet of the IPv4 broadcast address 255.255.255.255. Recognising 0xFF as eight 1-bits is fundamental to understanding byte-level operations.
Q:How do I expand a hex value to binary manually?
Replace each hex digit with its 4-bit binary equivalent. Use this 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. Example: 0xA5 → A=1010, 5=0101 → 1010 0101. The leading zero of each nibble must be kept — 5 is 0101, not just 101. The result always has exactly 4 × (number of hex digits) bits.
Q:Why is hex used to represent binary data instead of decimal?
Hex is preferred because of its exact 4:1 relationship with binary — every 4 binary bits map to one hex digit, and every byte (8 bits) maps to exactly two hex digits. This makes hex a compact but lossless shorthand for binary. Decimal has no such alignment — a decimal digit does not map to a fixed number of bits, making binary-to-decimal conversion require actual arithmetic, while binary-to-hex is a simple digit substitution. This efficiency is why hex is used in memory editors, network packets, cryptographic hashes, and color codes.
Q:Does the conversion handle odd-length hex strings?
Yes — if you enter an odd number of hex digits (e.g. 'F' or 'ABC'), the tool converts the entire value correctly and outputs the exact binary representation. The binary output is grouped into nibbles from right to left. A leading hex digit with fewer than 4 significant bits (e.g. hex 'F' = binary '1111' rather than '0000 1111') is shown without unnecessary leading zero padding. If you need a specific bit width, pad your hex input with leading zeros first.