Related Function:

The HEX2DEC function converts a hexadecimal number to decimal.

### Syntax

=HEX2DEC(number)

Note: Hexadecimal (base 16), decimal (base 10), octal (base 8), and binary (base 2) are the most commonly used numeral systems in engineering and computing. Therefore, Excel has provided functions to convert numeric values to and from each of these systems.

#### Arguments

Argument Description
number The hexadecimal number you want to convert

 • Number cannot contain more than 10 characters (40 bits) • The most significant bit of number is the sign bit • The remaining 39 bits are magnitude bits • Negative numbers are represented using two’s-complement notation

#### Examples

A B C
1 Formula Result Notes
2 =HEX2DEC(“A5”) 165 Converts hexadecimal A5 to decimal
3 =HEX2DEC(“A”) 10 Converts hexadecimal A to decimal
4 =HEX2DEC(“1F”) 31 Converts hexadecimal 1F to decimal
5 =HEX2DEC(“FFFFFFFFF0”) -16 Converts hexadecimal FFFFFFFFF0 to decimal

#### Common Function Error(s)

Problem What went wrong
#NUM! Occurs if either:

 • the supplied number argument is not recognized as a hexadecimal number • the supplied number argument contains more than 10 characters
#NAME? Occurs when Analysis ToolPak add-in is not enabled