Math & trig function

DECIMAL function

Converts text representing a number in another base (2–36) into an ordinary decimal number.

Available in Excel 2013 and later, Microsoft 365, Excel for the web, Excel for Mac 2016 and later

Excel 2013 and laterWorks in Google Sheets

Syntax

DECIMAL(text, radix)
ArgumentWhat it means
textRequiredThe digits in the source base, e.g. "FF" or "1010". Up to 255 characters; not case-sensitive.
radixRequiredThe source base, 2 to 36.

Returns: The decimal value as a number.

How DECIMAL works

DECIMAL is the reverse of BASE: it reads digits written in any base from 2 to 36 and returns the ordinary number. =DECIMAL("FF", 16) is 255 and =DECIMAL("1010", 2) is 10. Use it to decode hex colour codes, binary register values, octal file permissions or base-36 reference codes.

Letters stand for digits above 9 (A = 10 … Z = 35) and case does not matter. Every character must be valid for the base, otherwise the result is #NUM!: "2" is not a binary digit and "G" is not a hex digit. The result must be smaller than 2^53.

Examples

1Decode a hex colour channel

C2fx=DECIMAL(MID(B2, 3, 2), 16)
ABC
1ColourHex
2Brand orangeFF8C00140

Result: 140

MID takes the green pair 8C, and DECIMAL converts it to 140 (red FF = 255, blue 00 = 0).

2Read a binary value

A1fx=DECIMAL("1010", 2)
A
110

Result: 10

1×8 + 0×4 + 1×2 + 0×1 = 10.

3Decode a base-36 reference

B2fx=DECIMAL(A2, 36)
AB
1Code
221I3V9123456789

Result: 123456789

Turns the short code made with BASE back into the order number.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#NUM!A character is not valid in the given base, or radix outside 2–36.Check the text and the radix.
#VALUE!Text longer than 255 characters.Shorten the input.

Tips

  • Strip a leading # or 0x before converting: =DECIMAL(SUBSTITUTE(A2,"#",""),16).

Google Sheets

DECIMAL also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

DECIMAL in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DutchDECIMAAL
FinnishDESIMAALI
GermanDEZIMAL
HungarianTIZEDES
ItalianDECIMALE
Norwegian (Bokmål)DESIMAL
PolishDZIESIĘTNA
RussianДЕС
SpanishCONV.DECIMAL
TurkishONDALIK