DEC2OCT Function

DEC2OCT Function

DEC2OCT Function

Convert decimal numbers to octal text in Excel. Useful for Unix-style permissions, legacy systems, and older technical formats that still use base 8.

ExcelClash Team
PUBLISHED

Summary

DEC2OCT converts a decimal number into octal text. If you have a base-10 value and need the base-8 version, this function does the conversion directly.

It is especially useful when you work with old technical formats or Unix-style permission values. Most people do everyday math in decimal, but some systems still display or store values in octal, so DEC2OCT helps bridge that gap.

Purpose

Convert decimal to octal

Turns a base-10 number into base-8 text.

Return value

Octal text

Returns text made of digits 0 through 7.

Syntax

=DEC2OCT(number, [places])

number is the decimal value you want to convert. places is optional and pads the result with leading zeros when needed.

The formula returns octal text, so it is mainly a formatting and translation tool. If you need the shortest octal result, use just the number. If the output should match a fixed-width code such as a permission-style field, add places.

Arguments

  • number - [required] The decimal integer to convert. Excel supports values from -536,870,912 to 536,870,911.
  • [places] - [optional] The minimum number of characters to return for positive values.

number must be a whole number in the supported range. places is optional and only affects positive results. It helps when the sheet needs uniform-width octal output. If the converted result is longer than the places value you give, Excel returns #NUM!.

DEC2OCT vs similar functions

Use DEC2OCT when the output needs to stay in octal text form:

Function What it does Typical use Result
DEC2OCT Converts decimal to octal Permissions, legacy formats, code translation Octal text
OCT2DEC Converts octal to decimal Turn octal back into a number Number
DEC2BIN Converts decimal to binary Bit patterns and masks Binary text
DEC2HEX Converts decimal to hex Addresses and compact IDs Hex text

Using DEC2OCT

The main use is formatting a decimal value as octal text. A common example is Unix permissions, where a decimal total such as 493 maps to the octal code 755. Instead of converting it by hand, DEC2OCT handles that translation in one step.

The optional places argument lets you pad positive results with leading zeros. That is helpful when your output needs to fit a fixed width or match a standard display format. If the converted result needs more characters than you allowed in places, Excel returns #NUM!.

Negative values use the signed format built into these engineering conversion functions. Excel returns them as 10-character octal values and ignores places, so a result like 7777777777 for -1 is normal.

Example 1 - Convert 58 to octal

This is the basic decimal-to-octal conversion pattern. Excel returns 72, which is useful when a number that starts in ordinary base 10 needs to be expressed in a base-8 format used by a legacy system or code scheme.

=DEC2OCT(58) // Returns "72"
Check Answer
Challenge #1
Target: Sheet1!F1
Basic Octal Conversion

Convert Decimal 58 to octal. Formula: =DEC2OCT(58).

Example 2 - Build a 3-digit permission code

This example shows why the places argument can matter even when the converted value is already familiar. The decimal value 493 becomes the octal permission code 755, and the fixed width helps keep the result in the exact form usually expected in permission-style notation.

=DEC2OCT(493, 3) // Returns "755"
Check Answer
Challenge #2
Target: Sheet1!F2
Unix Permission Padding

Convert 493 into a 3-digit padded octal (755). Formula: =DEC2OCT(493, 3).

Example 3 - Convert a negative value

Negative inputs use Excel's signed engineering format rather than a simple prefixed minus sign. In this case, -1 becomes 7777777777. That is worth understanding if the worksheet needs to exchange signed values with systems that use these fixed-width conversion rules.

=DEC2OCT(-1) // Returns "7777777777"
Check Answer
Challenge #3
Target: Sheet1!F3
Negative Signed Octal

Convert -1 to its 10-character octal representation. Formula: =DEC2OCT(-1).

Example 4 - Create an octal code from 4032

The result 7700 shows how a larger decimal value maps into a compact octal code. This kind of conversion is useful when the destination format expects base 8 and the worksheet currently stores or calculates everything in decimal.

=DEC2OCT(4032) // Returns "7700"
Check Answer
Challenge #4
Target: Sheet1!F4
Aviation Squawk Audit

Convert decimal index 4032 to an octal transponder code. Formula: =DEC2OCT(4032).

Quick recap

  • Converts decimal to octal: DEC2OCT returns base-8 text from a base-10 number.
  • Places pads positive values: Use it when your output should have a fixed width.
  • Negative values ignore places: Excel returns them as 10-character signed octal strings.
  • Returns text: Use OCT2DEC if you want the value back as a number.
  • Useful for permissions and legacy formats: It is mostly a formatting and translation function.
Tactical Arena
Select Scenario:
Share DEC2OCT 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.