Author: Oscar Cronquist Article last updated on October 11, 2022

How to use the HEX2BIN function 1

The HEX2BIN function converts a hexadecimal number to a binary number.

1. HEX2BIN Function Syntax

HEX2BIN(number, [Places])

2. HEX2BIN Arguments

number Required. The hexadecimal number you want to convert to a decimal number.
[Places] Optional. How many digits to use, if omitted HEX2BIN uses the minimum number of required digits. Tip! Use [Places] for padding with leading 0's (zeros).

HEX2BIN function ignores [Places] argument if the hexadecimal is negative.

3. Comments

HEX2BIN returns a #NUM! error if an invalid hexadecimal value is used.

HEX2BIN returns the #VALUE! error if [Places] is a non-numeric value.

HEX2BIN returns the #NUM! error value if [Places] is a negative number.

4. HEX2BIN Function Example

How to use the HEX2BIN function 1

Formula in cell C3:

=HEX2BIN(B3)

5. How is hexadecimal to binary calculated?

Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Convert every hexadecimal to a binary using the table above.

5.1 Example 1

Hexadecimal value 664 is calculated to a binary like this:

Third hexadecimal value: 6 = 0110

Second hexadecimal value: 6 = 0110

First hexadecimal value: 4 = 0100

equals

0110 0110 0100

5.2 Example 2

Hexadecimal value F9F is calculated to decimal like this:

F = 1111

9 = 1001

F = 1111

equals

1111 1001 1111