
Convert hexadecimal text to decimal numbers in Excel. Useful when you need a regular numeric value from a hex code or address.
HEX2DEC converts a hexadecimal value into a decimal number. If a worksheet gives you a hex code like FF, this function turns it into the regular number 255.
This matters because hex is compact and common in technical systems, but decimal is easier to use in normal math. HEX2DEC lets you take a code that is convenient for a machine or report and turn it back into something you can filter, compare, and calculate with in Excel.
Turns a base-16 value into a base-10 number.
Returns a numeric value you can use in formulas right away.
=HEX2DEC(number)
number is the hexadecimal value to convert. Excel accepts up to 10 characters here.
You can type the hex value directly in quotes or point to a cell that already contains it. The result is a normal decimal number, so after the conversion you can use it in ordinary formulas without any extra cleanup.
The input must be a valid hex value. Excel accepts up to 10 characters in this engineering format, and 10-character values can be interpreted as signed numbers. If the text is not valid hexadecimal, Excel returns an error instead of guessing the meaning.
HEX2DEC is best when the final result needs to be a real number, not another formatted string:
| Function | What it does | Typical use | Result |
|---|---|---|---|
HEX2DEC |
Converts hex to decimal | Offsets, IDs, intensity values | Number |
DEC2HEX |
Converts decimal to hex | Format a number as hex text | Hex text |
HEX2BIN |
Converts hex to binary | Inspect bits behind a hex value | Binary text |
HEX2OCT |
Converts hex to octal | Move a hex value into base 8 | Octal text |
The main use is turning a hex value into a number you can work with normally. Once the value is in decimal form, you can compare it, subtract it from another value, use it in thresholds, or pass it into other numeric formulas without any extra conversion steps.
This is useful for things like addresses, offsets, and hex color components. A value like 0400 becomes 1024, and a value like A5 becomes 165. That makes the data much easier to read if the next step is analysis instead of display.
HEX2DEC also supports signed 10-character values in this engineering-function family. That means a result like FFFFFFFFFF is interpreted as a negative value rather than an extremely large positive one, so HEX2DEC("FFFFFFFFFF") returns -1.
This example shows the standard use of HEX2DEC: take a compact hex value and return the normal decimal number behind it. Excel converts FF to 255, which is much easier to reuse in arithmetic, thresholds, and comparisons.
=HEX2DEC("FF") // Returns 255
Convert Hex "FF" to decimal. Formula: =HEX2DEC("FF").
Leading zeros can matter for display, but they do not change the numeric value being represented. The hex address-style input 0400 still becomes 1024. That makes HEX2DEC useful when a formatted code needs to become a calculation-friendly number.
=HEX2DEC("0400") // Returns 1024
Convert Hex "0400" to a decimal address index. Formula: =HEX2DEC("0400").
This example highlights Excel's signed 10-character engineering format. Although FFFFFFFFFF looks like a very large positive hex value, HEX2DEC interprets it as -1. That distinction is essential when the input comes from a signed fixed-width system rather than an unsigned one.
=HEX2DEC("FFFFFFFFFF") // Returns -1
Convert Hex "FFFFFFFFFF" (-1) to decimal. Formula: =HEX2DEC("FFFFFFFFFF").
Hex values are also common in UI and graphics work. A color byte such as A5 becomes the decimal intensity 165, which is helpful if the next step in the worksheet needs numeric comparisons, calculations, or charting instead of a hex display string.
=HEX2DEC("A5") // Returns 165
Convert a red-channel hex "A5" to decimal. Formula: =HEX2DEC("A5").
FFFFFFFFFF becomes -1.Tell your friends about this post