OCT2DEC in Excel: Decode Octal Text and Signed Thirty-Bit Values
Convert base-eight fields to decimal in Excel, check positional weights and distinguish short positive codes from signed ten-digit octal inputs.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: OCT2DEC(number) converts an octal representation to decimal. Inputs contain at most ten digits from 0 through 7; full ten-digit values use a thirty-bit two’s-complement convention for negative numbers.
Availability and version history
- Introduced: the first introduction version is not established by the reviewed official history.
- Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2019 for Mac, Excel 2016. This particular reference lists Excel 2019 for Mac but omits Excel 2024 for Mac; those distinctions are preserved.
- Checked: October 14, 2026; official OCT2DEC reference. Documentation and independent models; no native Excel execution or wider platform certification.
Syntax and the base-eight rule
=OCT2DEC(number)
The argument is required. Each octal digit represents three binary bits, so ten octal digits span thirty bits. Microsoft documents #NUM! for an invalid octal number. Digits 8 and 9 are not part of this base.
The reference describes the highest bit as a sign bit and explicitly identifies two’s-complement notation. For a negative full-width value, subtract 2^30, or 1073741824, from its unsigned positional value. It is not a sign-and-magnitude representation.
Use explicit quoted strings or Text-formatted input cells to preserve leading zeros. The examples do not assume that programming-language prefixes, embedded spaces or other import decorations are accepted.
Example 1: decode a base-eight data column
Format A2:A7 as Text and enter these strings. Put =OCT2DEC(A2) in B2 and fill through B7.
| A, octal text | Expected decimal |
|---|---|
| 7 | 7 |
| 10 | 8 |
| 17 | 15 |
| 54 | 44 |
| 125 | 85 |
| 754 | 492 |
Octal 10 is 1×8+0=8. Octal 125 is 1×64+2×8+5=85. For 754, the calculation is 7×64+5×8+4=492.
A direct formula =OCT2DEC("754") returns 492, not decimal 754. The conversion interprets the digit positions in base eight. In contrast, entering the number 754 into an ordinary numeric cell leaves it as the decimal quantity 754 until a conversion function interprets its representation.
Leading zeros do not add positional value: =OCT2DEC("000754") also returns 492. Preserve the original column if a fixed field width is part of the import specification.
Example 2: inspect the signed boundary
| Formula | Expected decimal |
|---|---|
=OCT2DEC("777") |
511 |
=OCT2DEC("3777777777") |
536870911 |
=OCT2DEC("4000000000") |
-536870912 |
=OCT2DEC("7777777777") |
-1 |
=OCT2DEC("7777777533") |
-165 |
The final row is also a documented Microsoft control. Its unsigned positional value is 1073741659, which becomes −165 after subtracting 1073741824.
The first digit of every short code is not automatically a sign. The short string 777 has value 511. At ten digits, an initial octal digit 4 through 7 sets the highest of the thirty bits and enters the negative half of the encoding.
The largest positive full-width value begins with 3 because binary 3 is 011. The smallest negative begins with 4 because binary 4 is 100. This connects the octal boundary to the underlying binary sign bit.
Advanced example: independently audit three-digit fields
This example defines a three-digit base-eight field, with each digit from 0 through 7. Enter 125, 754 and 007 as text in D2:D4. In E2 enter:
=VALUE(LEFT(D2,1))*64+VALUE(MID(D2,2,1))*8+VALUE(RIGHT(D2,1))
Fill through E4. The expected values are 85, 492 and 7. In F2 enter =OCT2DEC(D2) and fill down. These results match E2:E4.
This expansion uses the defined three-character layout; it is an independent positional check, not a general replacement for OCT2DEC. LEFT, MID and RIGHT extract the digits, while VALUE converts the individual decimal digit characters for arithmetic.
A cross-base check for 754 is binary 111101100 and hexadecimal 1EC. =BIN2DEC("111101100") and =HEX2DEC("1EC") both produce 492. The binary string stays within BIN2DEC’s positive range; larger octal inputs may not fit that converter’s narrower format.
Common errors and interpretation checks
=OCT2DEC("128") contains an invalid digit and follows the documented #NUM! rule. More than ten octal characters is outside the stated input contract, even when leading zeros make the positional value small; this guide does not assign an unverified exact error code to every length case.
Do not apply the thirty-bit negative convention to a source that defines a different signed width. Also keep a code’s meaning separate from its numeric value: a three-digit label might encode several independent fields rather than one quantity to total.
The expected outputs are exact positional calculations. Native text coercion, prefix handling and error precedence were not executed, and the availability list preserves this function’s own documented Mac-version differences.
References and verification
Expected outputs are independently calculated examples or documented rules, not captured native Excel results. Formulas use English function names and comma argument separators. Locale, rendering and boundary restrictions are stated where relevant.