
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.
HEX2DEC is often the practical step that makes a coded value usable in the rest of the workbook. Once a hex value is back in decimal form, it fits more naturally into comparisons, summaries, thresholds, and other ordinary spreadsheet logic while preserving the original technical meaning.
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.
That is the main reason this function exists. Hex is compact for display, but decimal is easier for everyday spreadsheet work, so the example shows the simplest path from one form to the other.
=HEX2DEC("FF") // Returns 255
Convert Hex "FF" to decimal.
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.
This example is helpful because beginners often wonder whether the leading zero changes the result. Here it shows that the appearance is different, but the stored amount behind the code is still the same number.
=HEX2DEC("0400") // Returns 1024
Convert Hex "0400" to a decimal address index.
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.
This is exactly the kind of case that can confuse learners, so the example is useful beyond the formula itself. It teaches that some 10-character hex values are meant to be read as signed results, not just big positive numbers.
=HEX2DEC("FFFFFFFFFF") // Returns -1
Convert Hex "FFFFFFFFFF" (-1) to decimal.
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.
So this example shows a more everyday use case. It is not only about technical memory values. HEX2DEC can also help when design-related hex values need to become normal numbers inside the sheet.
=HEX2DEC("A5") // Returns 165
Convert a red-channel hex "A5" to decimal.
HEX2DEC is most useful when a hexadecimal code needs to become a normal number again. In this lesson, that meant taking values that are easy to store or display in hex and converting them into decimal so Excel can compare, analyze, or calculate with them more directly.
That is why HEX2DEC often sits at the start of a workflow rather than the end of one. Once the value is back in decimal form, it becomes easier to use in formulas, filters, summaries, and checks. The only extra care is remembering that Excel can also interpret signed 10-character hex input as negative.
FFFFFFFFFF becomes -1.Tell your friends about this post