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

How to use the HEX2DEC function 1

The HEX2DEC function converts a hexadecimal number to a decimal number.

1. HEX2DEC Function Syntax

HEX2DEC(number)

2. HEX2DEC Arguments

number Required. The hexadecimal number you want to convert to a decimal number.

3. Comments

The hexadecimal numeral system has a base of 16, 0-9 represents zero to nine, and A, B, C, D, E, and F represent values ten to fifteen.

For example, binary values ranging from 00000000 to 11111111 are represented as 00 to FF in hexadecimal which makes it easier to read.

The largest hexadecimal number contains 10 characters, more characters are not allowed.

4. HEX2DEC Function Example

How to use the HEX2DEC function 1

Formula in cell D3:

=HEX2DEC(B3,C3)

5. How is hexadecimal to decimal calculated?

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

xyz

becomes

x * (16 ^ 2)

y * (16 ^ 1)

z * (16 ^ 0)

equals

x * (16 ^ 2) + y * (16 ^ 1)  + z * (16 ^ 0)

5.1 Example 1

Hexadecimal value 664 is calculated to decimal like this:

Third hexadecimal value: 6*16^2 = 6*256 = 1536

Second hexadecimal value: 6*16^1 = 6*16 = 96

First hexadecimal value: 4*16^0 = 4*1 = 4

1536+96+4

equals

1636.

5.2 Example 2

Hexadecimal value F9F is calculated to decimal like this:

F = 15, see the table above. F is the third character from the right. 15*16^2 = 3840

9 is the second character from the right. 9*16^1=144

F = 15

Add the numbers: 3840 + 144 + 15 equals 3999

External links

Hexadecimal to decimal