
Convert hexadecimal values to binary text in Excel. Useful when you want to inspect bits behind a hex code or register value.
HEX2BIN converts hexadecimal text into binary text. It is useful when a value is easier to store or read in hex, but you want to see the actual bit pattern behind it.
This is common in technical sheets because hex is compact, while binary makes individual bits visible. If you are checking flags, masks, or small register values, HEX2BIN helps you move from the compact form to the detailed form quickly.
Turns a base-16 value into base-2 text.
Returns a string made of 1 and 0.
=HEX2BIN(number, [places])
number is the hex value to convert. places is optional and pads positive results with leading zeros.
The formula takes a hexadecimal input and expands it into binary text. Use places when the output has to match a fixed-width bit field. If you leave it out, Excel returns the natural binary length of the positive value.
number should be a valid hex value using digits 0-9 and letters A-F. places is optional and only applies to positive results. If the binary result is longer than the places value, Excel returns #NUM!. Signed negative values use Excel's fixed engineering-format behavior instead of ordinary padding.
HEX2BIN is useful when the final goal is to inspect bits, not just convert between number systems:
| Function | What it does | Typical use | Result |
|---|---|---|---|
HEX2BIN |
Converts hex to binary | Flags, masks, and bit inspection | Binary text |
HEX2DEC |
Converts hex to decimal | Get a number you can use in math | Number |
HEX2OCT |
Converts hex to octal | Move into a legacy base-8 format | Octal text |
BIN2DEC |
Converts binary to decimal | Turn bits back into a number | Number |
The simplest use is taking a short hex value like F or 1C and expanding it into binary so the bit pattern is easy to read. A value that looks compact in hex can become much clearer once you see every digit as a 1 or 0.
The optional places argument helps when you want the output to line up with a fixed bit width. For example, A becomes 1010 by default, but with 8 places it becomes 00001010. If the converted result is longer than the places value, Excel returns #NUM!.
There is one important limit here. Even though HEX2BIN accepts hex input up to 10 characters, the output range is still limited to values that fit the function's signed binary rules. Negative values return signed 10-bit results, and larger positive values outside the supported range return #NUM!.
This example shows the direct relationship between a single hex digit and a 4-bit binary pattern. The value F becomes 1111, which is useful whenever you want to expand a compact hex value into the individual bits it represents.
=HEX2BIN("F") // Returns "1111"
Convert Hex "F" to binary. Formula: =HEX2BIN("F").
The places argument is important when the binary output has to match a fixed-width field such as a byte. Without padding, A would become 1010. With 8 places, Excel returns 00001010, which keeps the value the same while preserving the expected field width.
=HEX2BIN("A", 8) // Returns "00001010"
Convert Hex "A" to a padded 8-bit binary string. Formula: =HEX2BIN("A", 8).
This example shows how signed values are handled in Excel's engineering conversion functions. The 10-character hex input represents -1, so HEX2BIN returns the signed 10-bit binary form 1111111111. That behavior is important if your source data uses signed fixed-width values rather than plain positive codes.
=HEX2BIN("FFFFFFFFFF") // Returns "1111111111"
Convert -1 (Hex FFFFFFFFFF) to 10-bit binary. Formula: =HEX2BIN("FFFFFFFFFF").
The hex value 1C is short and compact, but the binary version 0000011100 makes the active bit positions much easier to inspect. This is the kind of conversion that helps when you are checking masks, status fields, or small register values.
=HEX2BIN("1C", 10) // Returns "0000011100"
Convert Hex "1C" to a 10-bit binary mask. Formula: =HEX2BIN("1C", 10).
#NUM!.Tell your friends about this post