Engineering function

OCT2DEC function

Converts an octal number such as "755" to decimal (493). A 10-digit value starting with 4–7 is read as negative.

Available in Excel 2007 and later (Excel 2003 needed the Analysis ToolPak add-in), Microsoft 365, Excel for the web, Excel for Mac

Excel 2007 and laterWorks in Google Sheets

Syntax

OCT2DEC(number)
ArgumentWhat it means
numberRequiredThe octal number to convert, as text or a number. At most 10 characters (30 bits): -536,870,912 to 536,870,911. A 10-character value whose first digit is the highest one is read as negative (two's complement).

Returns: A decimal number (which can be negative).

How OCT2DEC works

OCT2DEC turns an octal (base-8) value into a normal decimal number. Each position is worth eight times the one to its right, so 755 is 7×64 + 5×8 + 5 = 493. You will mostly meet octal in Unix file permissions and in older computing and avionics documentation (aircraft transponder squawk codes are octal digits too).

Inputs can be up to 10 octal digits (30 bits). A 10-digit input whose first digit is 4 or more is negative in two's complement, so 7777777533 returns -165. Any digit 8 or 9 makes the input invalid and returns #NUM!.

Examples

1Permission code to decimal

B2fx=OCT2DEC(A2)
AB
1Octal
2755493

Result: 493

7×64 + 5×8 + 5 = 448 + 40 + 5 = 493.

2Read a negative two's-complement value

B2fx=OCT2DEC(A2)
AB
1Octal
27777777533-165

Result: -165

The input is 10 digits and starts with 7, so the sign bit is set and Excel returns -165.

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

Common errors and how to fix them

ErrorWhy it happensFix
#NUM!The input contains 8 or 9, is longer than 10 characters, or is otherwise not octal.Check the source; a value with 8 or 9 is decimal, not octal.

Tips

  • Octal values typed as numbers lose leading zeros; that does not change the result, but store them as text if you want to see them.
  • For values longer than 10 digits, use =DECIMAL(A2, 8).

Google Sheets

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

OCT2DEC 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
DanishOKT.TIL.DEC
DutchOCT.N.DEC
FinnishOKTDES
FrenchOCTDEC
GermanOKTINDEZ
HungarianOKT.DEC
ItalianOCT.DECIMALE
Norwegian (Bokmål)OKTTILDES
PolishÓSM.NA.DZIES
Portuguese (Brazil)OCTADEC
Portuguese (Portugal)OCTADEC
RussianВОСЬМ.В.ДЕС
SpanishOCT.A.DEC
SwedishOKT.TILL.DEC