
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.
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.
=DEC2OCT(58) // Returns "72"
Convert Decimal 58 to octal. Formula: =DEC2OCT(58).
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"
Convert 493 into a 3-digit padded octal (755). Formula: =DEC2OCT(493, 3).
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"
Convert -1 to its 10-character octal representation. Formula: =DEC2OCT(-1).
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"
Convert decimal index 4032 to an octal transponder code. Formula: =DEC2OCT(4032).
OCT2DEC if you want the value back as a number.Tell your friends about this post