U.UtilityApp
🔄 ConvertersFree · No signup

Hex to Binary Converter

Convert hexadecimal numbers to binary.

Each hex digit is exactly four bits

Hex to binary needs no arithmetic. Replace each hex digit with its four-bit pattern from this table and join them:

HexBinaryHexBinary
0000081000
1000191001
20010A1010
30011B1011
40100C1100
50101D1101
60110E1110
70111F1111

So A5 is 1010 and 0101, giving 10100101. Because every digit maps on its own, you can check any part of a long result against the table.

Reading flags and bit fields from a hex value

Datasheets, register maps and debuggers print values in hex, but the meaning sits in individual bits. Convert to binary to see which ones are set. A status byte of 3C is 00111100: counting from 0 at the right, bits 2, 3, 4 and 5 are on and the rest are off. A mask of F0 is 11110000, so it keeps the top four bits of a byte and clears the bottom four.

Put the leading zeros back

The converter returns the shortest binary form. It drops leading zeros and doesn't space the output into groups of four:

  • 0F gives 1111, not 00001111
  • 3C gives 111100, not 00111100
  • 1F4 gives 111110100, not 0001 1111 0100

The full result should have four bits for every hex digit you typed. If it's shorter, add zeros on the left until it is. Skipping this step is the usual reason bit numbers end up off by a few places.

Prefixes, separators and long values

A 0x prefix is accepted (0x0F gives 1111) and spaces are removed. A # gives an error. Any other character ends the reading without a warning, so only the digits before it are converted.

The result is exact for values up to 1FFFFFFFFFFFFF. For a longer string, such as a hash, split it into chunks of up to 12 hex digits, convert each chunk, pad each result to four bits per digit, and join them. Since each hex digit maps to its own four bits, the joined string is the same as converting the whole value at once.

Frequently asked questions

Can I convert a MAC address or other colon-separated hex?+

Remove the colons first. A colon stops the reading, so AA:BB converts only AA, giving 10101010. Without separators a 12-digit MAC address fits within the exact range.

Is hex to binary the same as decoding hex into text?+

No. This converter gives the bits of the number. Turning hex bytes into readable characters is a separate step, where each pair of hex digits is looked up as a character code.

Does upper or lower case matter?+

No. a5 and A5 give the same bits, 10100101.

Embed this tool on your website

Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.

<iframe src="https://utilityapp.lat/embed/convert/hex-to-binary" title="Hex to Binary Converter" width="100%" height="420" style="border:0;max-width:760px" loading="lazy"></iframe>
<p style="font-size:13px"><a href="https://utilityapp.lat/convert/hex-to-binary">Hex to Binary Converter</a> by UtilityApp</p>