HEX2DEC Function

Excel Functions › Engineering

All versions Engineering

The Excel HEX2DEC function converts a hexadecimal (base-16) number to decimal (base-10) — a staple for digital electronics, low-level programming, and bit manipulation.


Quick answer:
=HEX2DEC("2A") // 2A (hexadecimal) = 42 (decimal)

Syntax

=HEX2DEC(number)
ArgumentDescription
numberRequiredThe hexadecimal number to convert, as text or a value.

How to use it

HEX2DEC converts a hexadecimal (base-16) value to decimal (base-10). The result is returned as text for non-decimal, or a number for decimal.

=HEX2DEC("2A") // 2A (hexadecimal) = 42 (decimal)

Round-trip tip: every conversion has an inverse — pair this with the reverse function to validate. All base functions cap inputs at 10 characters (signed), so very large numbers need a different approach.

Try it: interactive demo

Live demo

Type a hexadecimal value and watch it convert to decimal.

Result:

Practice workbook

📊
Download the free HEX2DEC practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Why is the HEX2DEC result text, not a number?
Base conversions (except to decimal) return text so leading zeros and hex letters are preserved. Wrap in VALUE or the reverse function if you need a number.
What is the places argument for?
It pads the result with leading zeros to a fixed width — e.g. DEC2BIN(5,8) gives 00000101. Handy for byte-aligned output.
Why do I get #NUM!?
The input isn’t a valid hexadecimal value (wrong digits), or it exceeds the 10-character signed limit of the base functions.
How do negative numbers work?
The base functions use two’s-complement notation within their 10-digit limit; the top digit signals the sign.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: DEC2BIN · BIN2DEC · DEC2HEX · HEX2DEC