Hex to Decimal in Excel — Formula Guide and Free Tool
- Excel formula: =HEX2DEC(A1) converts a hex value in cell A1 to decimal
- For decimal to hex, use =DEC2HEX(A1)
- Excel caps at 10 hex digits (40-bit signed) — larger values need a different approach
- Browser converter has no size limit and shows binary and octal too
Table of Contents
To convert hex to decimal in Excel, use the built-in =HEX2DEC() function. Enter your hex value in a cell, type =HEX2DEC(A1) in an adjacent cell (replacing A1 with your cell reference), and Excel returns the decimal integer. No add-in required.
For one-off conversions or values Excel cannot handle, the Number Base Converter does the same job instantly in your browser — type the hex value and get decimal, binary, and octal all at once.
The HEX2DEC Formula — Syntax and Examples
The Excel function syntax is: =HEX2DEC(number)
Where number is the hex string you want to convert. It can be a direct string like "FF" or a cell reference like A1.
| Formula | Hex Input | Decimal Output |
|---|---|---|
| =HEX2DEC("FF") | FF | 255 |
| =HEX2DEC("1A") | 1A | 26 |
| =HEX2DEC("10") | 10 | 16 |
| =HEX2DEC("1000") | 1000 | 4096 |
| =HEX2DEC(A2) | (value in A2) | (result) |
Note: Excel treats hex input as upper case and is not case-sensitive. "ff" and "FF" both work.
Decimal to Hex in Excel — DEC2HEX
For the reverse conversion, use =DEC2HEX(number, [places]). The optional places argument pads the result with leading zeros to a fixed width.
| Formula | Decimal | Hex Output |
|---|---|---|
| =DEC2HEX(255) | 255 | FF |
| =DEC2HEX(255, 4) | 255 | 00FF |
| =DEC2HEX(16) | 16 | 10 |
| =DEC2HEX(4096) | 4096 | 1000 |
The padded version (with a places argument) is useful when you need consistent field widths — for example, all color hex codes formatted as 6 characters.
Sell Custom Apparel — We Handle Printing & Free ShippingExcel's HEX2DEC Limitations
Excel's conversion functions have a cap: HEX2DEC accepts up to 10 hex digits (40-bit signed integers). The maximum input is 7FFFFFFFFF (about 549 billion). If you enter a larger hex value, Excel returns a #NUM! error.
Other limitations:
- Negative hex values are represented in two's complement (not supported intuitively)
- No built-in Excel function for hex to binary or hex to octal directly
- The POWER QUERY decimal to hex approach requires more steps
For values larger than 40 bits, or if you need binary or octal output, the browser converter handles integers up to roughly 9 quadrillion without any such limitation.
Converting a Column of Hex Values in Excel
If you have a column of hex values to convert in bulk:
- Put your hex values in column A (A1 through A100, for example)
- In cell B1, enter: =HEX2DEC(A1)
- Press Enter, then select cell B1 again
- Copy the formula down column B — double-click the fill handle or drag it down
- All decimal equivalents populate automatically
To keep only the values (remove the formula dependency), select column B, copy, then Paste Special → Values Only.
When to Use the Browser Tool Instead of Excel
Excel is the right choice when you have a spreadsheet full of hex values and need decimal equivalents in adjacent columns — bulk conversion with the formula dragged down a column is fast and clean.
Use the browser converter when:
- You need a one-off conversion and do not want to open Excel
- The hex value exceeds Excel's 10-digit limit
- You also need binary or octal output (Excel has no single-step function for those)
- You want to verify an Excel result against an independent tool
The Number Base Converter shows decimal, binary, octal, and hex simultaneously — which is particularly useful for cross-checking values when one format alone is ambiguous.
Need a Quick One-Off Hex Conversion?
Type any hex value and get decimal, binary, and octal all at once — no spreadsheet, no formula, no 40-digit limit.
Convert Numbers FreeFrequently Asked Questions
Why does HEX2DEC return a negative number?
If the hex value starts with a digit greater than 7 in its most significant nibble, Excel interprets it as a negative number using two's complement representation. This is by design for compatibility with signed 40-bit integers. If you want the unsigned decimal value, the browser converter shows the standard unsigned result.
How do I convert hex to binary in Excel?
Excel has no direct HEX2BIN function for values longer than 4 bits. For short values up to 4 hex digits, you can chain HEX2DEC and then DEC2BIN. For any length hex value, the browser converter shows the binary output instantly without any formula chaining.
Does Google Sheets support HEX2DEC?
Yes. Google Sheets supports the same HEX2DEC and DEC2HEX functions with identical syntax. Copy the same formulas into Sheets and they work the same way.

