Engineering

DEC2OCT Formula

Converts a decimal (base 10) integer to its octal (base 8) representation as a text string. DEC2OCT is used primarily in Unix/Linux file permissions, legacy computing systems, and certain engineering contexts where octal notation is the convention.

Syntax

DEC2OCT(number, [places])
ParameterDescription
number Parameter of the DEC2OCT function.
[places] (Optional.) Parameter of the DEC2OCT function.
Try DEC2OCT in Viztab — free, no signup

Examples

Basic conversion

Formula
=DEC2OCT(64)
'100'. The decimal number 64 equals 100 in octal (1*64 + 0*8 + 0).

Unix file permission

Formula
=DEC2OCT(493)
'755'. Decimal 493 = octal 755, which is the standard rwxr-xr-x Unix file permission.

Padded output

Formula
=DEC2OCT(8, 4)
'0010'. The decimal number 8 in octal is 10, padded to 4 digits with leading zeros.

Common Errors

#NUM!

The number is outside the valid range (-536,870,912 to 536,870,911), or places is too small for the result.

#VALUE!

The argument is non-numeric.

Tips

Unix permissions mapping

Use DEC2OCT to convert file permission numbers: 493=755 (rwxr-xr-x), 420=644 (rw-r--r--), 509=775 (rwxrwxr-x).

30-bit range

DEC2OCT handles numbers in the 30-bit signed range. This is sufficient for most file permission and legacy computing uses.

Result is always text

Like other DEC2 functions, the result is a text string. Don't treat '100' as the number one hundred — it represents 64 in decimal.

Try DEC2OCT in Viztab

Import your data and use DEC2OCT with 370+ other formulas. No signup required.

Open Viztab

Related Formulas