HEX2DEC Function

HEX2DEC Function

HEX2DEC Function

Convert hexadecimal text to decimal numbers in Excel. Useful when you need a regular numeric value from a hex code or address.

ExcelClash Team
PUBLISHED

Summary

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.

Purpose

Convert hex to decimal

Turns a base-16 value into a base-10 number.

Return value

Number

Returns a numeric value you can use in formulas right away.

Syntax

=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.

Arguments

  • number - [required] The hexadecimal text to convert.

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 vs similar functions

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

Using HEX2DEC

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.

Example 1 - Convert FF to decimal

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
Check Answer
Challenge #1
Target: Sheet1!F1
Basic Hex to Decimal Recovery

Convert Hex "FF" to decimal. Formula: =HEX2DEC("FF").

Example 2 - Convert a hex address

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
Check Answer
Challenge #2
Target: Sheet1!F2
Memory Address Parsing

Convert Hex "0400" to a decimal address index. Formula: =HEX2DEC("0400").

Example 3 - Decode a signed negative value

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
Check Answer
Challenge #3
Target: Sheet1!F3
Signed 40-Bit Negative Decode

Convert Hex "FFFFFFFFFF" (-1) to decimal. Formula: =HEX2DEC("FFFFFFFFFF").

Example 4 - Convert a color byte

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
Check Answer
Challenge #4
Target: Sheet1!F4
Color Intensity Check

Convert a red-channel hex "A5" to decimal. Formula: =HEX2DEC("A5").

Quick recap

  • Converts hex to decimal: HEX2DEC returns a normal numeric value.
  • Good for analysis: Use it when the next step is math, filtering, or comparison.
  • Accepts up to 10 hex characters: That includes signed values in Excel's engineering format.
  • Understands signed negative input: A value like FFFFFFFFFF becomes -1.
  • Useful beyond hardware: It also works well for short hex values like RGB color components.
Tactical Arena
Select Scenario:
Share HEX2DEC Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.