Engineering
HEX2DEC Function in Excel
Converts a hexadecimal number to decimal.
Syntax
- =HEX2DEC(number)
Arguments
- number (required): Hexadecimal number
Examples
- =HEX2DEC("A5") - Hex to decimal - Result: 165
HEX2DEC in technical sheets
- Document units in adjacent cells — many engineering functions require exact unit strings.
- Use [CONVERT](/functions/convert/) for unit changes before specialized formulas.
- Validate inputs with [ISNUMBER](/functions/isnumber/) and range checks.
Common errors
- #NUM! if not valid hex
Use cases
- Color conversion
- Memory addresses
- Programming
Frequently asked questions
- How do I convert hex color codes to RGB? Split the hex code and convert each pair: R=HEX2DEC(MID(A1,2,2)), G=HEX2DEC(MID(A1,4,2)), B=HEX2DEC(MID(A1,6,2)). For "#FF8000": R=255, G=128, B=0 (orange).
- Can HEX2DEC handle lowercase letters? Yes! HEX2DEC is case-insensitive. HEX2DEC("ff"), HEX2DEC("FF"), and HEX2DEC("Ff") all return 255. No need to convert case before using the function.
- What is the maximum hex value HEX2DEC can convert? HEX2DEC handles up to 10 hex characters, max value FFFFFFFFFF (1,099,511,627,775). For negative numbers, 10-character values starting with 8-F are treated as negative (two's complement).
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.
When to use HEX2DEC
- Color conversion — common Engineering scenario for HEX2DEC.
- Memory addresses — common Engineering scenario for HEX2DEC.
- Programming — common Engineering scenario for HEX2DEC.
HEX2DEC in the Engineering category
- Browse all Engineering functions at /categories/engineering/ for related formulas.
- HEX2DEC syntax: =HEX2DEC(number)
- number (required): Hexadecimal number
- Confirm HEX2DEC arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
Formula checklist before you copy down
- Confirm HEX2DEC arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
- If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
- Spot-check three known input rows manually against expected output.
Related Excel functions
- DEC2HEX (/functions/dec2hex/): Converts a decimal number to hexadecimal.
- HEX2BIN (/functions/hex2bin/): Converts a hexadecimal number to binary.
- HEX2OCT (/functions/hex2oct/): Converts a hexadecimal number to octal.
Errors to watch for
- #NUM! if not valid hex — review causes on linked error pages in the directory.
Copy-paste audit workflow
- Enter HEX2DEC on three test rows with known expected output documented on a QA tab.
- Fill down only after absolute references are locked on lookup tables and rate tables.
- Compare against manual calculation or a calculator for financial and statistical functions.
- Search this directory for comparison guides when choosing between similar functions in the same category.
HEX2DEC worked examples to copy
- =HEX2DEC("A5") — Hex to decimal. Expected result: 165.
HEX2DEC reference summary for crawlers and offline review
- HEX2DEC belongs to the Engineering category in Excel. Converts a hexadecimal number to decimal.
- Full syntax: =HEX2DEC(number). Open /functions/hex2dec/ for parameters, FAQs, and related pages.
- Common mistakes: #NUM! if not valid hex
- Pair this function with comparison guides when another Excel formula might fit the same task better.
- Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.