
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.
HEX2BIN is valuable when the compactness of hexadecimal stops being helpful and the actual bit layout needs to be visible. By expanding the value into binary text, the workbook can expose masks, flags, or register-style patterns that are much harder to inspect in hex form alone.
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.
It is a good beginner example because one hex digit maps neatly to one small bit group. That makes it easy to see how HEX2BIN turns a short code into a bit pattern you can inspect more closely.
=HEX2BIN("F") // Returns "1111"
Convert Hex "F" to binary.
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.
This matters because some systems care about the shape of the output as much as the value itself. The example shows how HEX2BIN can prepare data for an 8-bit display without changing the meaning of the number.
=HEX2BIN("A", 8) // Returns "00001010"
Convert Hex "A" to a padded 8-bit binary string.
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.
This is one of the most important examples in the lesson because the result can look strange if you expect normal positive conversion. It teaches that some long hex inputs carry sign meaning, not just magnitude.
=HEX2BIN("FFFFFFFFFF") // Returns "1111111111"
Convert -1 (Hex FFFFFFFFFF) to 10-bit binary.
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.
So the example is really showing why someone would convert the value at all. The hex form is shorter, but the binary form makes the bit layout visible right away.
=HEX2BIN("1C", 10) // Returns "0000011100"
Convert Hex "1C" to a 10-bit binary mask.
HEX2BIN is most useful when a compact hexadecimal code needs to be opened up into a visible bit pattern. In this lesson, that mattered because the binary result makes masks, flags, and register-style values much easier to inspect than the shorter hex form does.
That is why HEX2BIN is usually about readability, not arithmetic. The result comes back as text, and the optional places argument helps shape positive values into a fixed-width binary field when the layout of the bits matters as much as the value itself.
#NUM!.Tell your friends about this post