Base-16 to base-2
Hex to Binary Converter
Convert hex values like FF, 0x2A, or deadbeef into binary with a clean digit-by-digit breakdown.
Hexadecimal to binary mapping
Hexadecimal uses sixteen symbols: 0-9 and A-F. Each symbol represents exactly four binary bits, so conversion is mostly a lookup table rather than long arithmetic.
For example, 2A becomes 0010 1010. The first digit 2 maps to 0010, and A maps to 1010.
| Hex | Binary | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 8 | 1000 | 8 |
| A | 1010 | 10 |
| F | 1111 | 15 |
This fixed-width relationship is why hex appears so often in programming tools. A byte can be shown as two hex digits or eight binary bits, which makes values shorter to read without losing the underlying bit pattern. Color values, checksums, memory addresses, packet examples, and encoded identifiers often use hex for this reason.
BinaryTrans keeps leading zeroes in each four-bit group so the result stays aligned with the original hex digits. That makes it easier to compare output visually, copy groups into notes, or explain how each symbol expands. If your source value includes a 0x prefix, the converter ignores it and treats the remaining characters as the hexadecimal value.
Common hex to binary examples
FFbecomes1111 1111.2Abecomes0010 1010.0xFFis treated asFFand becomes1111 1111.DEADBEEFexpands into eight four-bit binary groups.- Hex color values can be inspected one byte at a time, such as
FF0000for red.
Why each hex digit becomes four bits
Hexadecimal uses sixteen symbols, from 0 through 9 and A through F. Four binary bits have sixteen possible combinations, so every hex digit maps to exactly one four-bit group. For example, A is decimal 10 and binary 1010, while F is decimal 15 and binary 1111. This one-to-one relationship is why hexadecimal is convenient for reading bytes.
When the input is 2A, the converter expands it to 0010 1010. The leading zeroes are significant for readability because they keep the byte width consistent. The value is the same as 101010, but the padded form makes it easier to compare with an 8-bit binary table or a character byte.
Hex values versus text characters
A hex value may be a number, a color component, a memory value, or a byte from encoded text. This page converts the numeric notation only. If you need to turn character text into binary, use Text to Binary. If you need to decode binary character groups, use Binary to Text and check the relevant encoding.