
Convert decimal numbers to octal text in Excel. Useful for Unix-style permissions, legacy systems, and older technical formats that still use base 8.
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.
DEC2OCT is mostly about compatibility with base-8 outputs. It is useful when the workbook calculates in decimal but still has to generate octal text for another system, report, or teaching context. In that sense, it acts more like a translator than a calculator.
Turns a base-10 number into base-8 text.
Returns text made of digits 0 through 7.
=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.
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!.
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 |
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.
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.
The example is simple on purpose. It gives a clear starting point before the learner moves into padded results or signed values.
=DEC2OCT(58) // Returns "72"
Convert Decimal 58 to octal.
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.
This makes the example practical because many users know 755 as a permission code, not as a decimal value. DEC2OCT helps bridge that gap and explains where the familiar octal result comes from.
=DEC2OCT(493, 3) // Returns "755"
Convert 493 into a 3-digit padded octal (755).
Negative inputs use Excel's signed engineering format rather than a simple prefixed minus sign. In this case, -1 becomes 7777777777.
This example is important because the output can look confusing at first. It shows that the long octal string is how Excel represents the signed value in this function family, so the learner knows the result is expected.
=DEC2OCT(-1) // Returns "7777777777"
Convert -1 to its 10-character octal representation.
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.
So the example is really showing a translation step. The math can stay in decimal inside the workbook, then DEC2OCT can produce the octal version only when the output needs that format.
=DEC2OCT(4032) // Returns "7700"
Convert decimal index 4032 to an octal transponder code.
DEC2OCT is most useful when a workbook calculates in normal decimal form but the final output needs to be expressed in octal. In this lesson, the function acted as a formatting bridge, letting the sheet keep its internal math simple while still producing base-8 text for the destination format.
That is why DEC2OCT is better thought of as a conversion and presentation tool than a math function. It returns text, and the optional places argument only helps with positive values that need a fixed-width octal result.
OCT2DEC if you want the value back as a number.Tell your friends about this post