Contact

OCT2DEC in Apple Numbers: Convert Octal Strings to Decimal

Engineering Intermediate Apple Numbers

OCT2DEC in Apple Numbers explained with exact argument rules, octal-to-decimal examples, padding, errors and table-based conversions.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Apple Numbers. How formula examples are checked

Verification (13 October 2026): Apple documentation and independent base arithmetic were checked. Results are expected values, not native Numbers measurements. No native app, import/export or screenshot testing was performed.

Quick answer: what OCT2DEC does

OCT2DEC turns an octal (base-8) number string into its familiar decimal (base-10) representation. Its value is especially clear for permissions, technical identifiers and legacy data: octal 755 is decimal 493, not decimal 755.

Example: =OCT2DEC(127,4) → 0087 (Apple’s documented expected display; not a native test). Apple official OCT2DEC help, v15.4 (checked 2026-10-13).

Syntax and arguments

=OCT2DEC(octal-string, convert-length)

octal-string (required, string): a base-8 representation containing only digits 0–7. Apple publishes numeric literals as examples, but a quoted literal or text cell is clearer when you need to preserve leading zeros in the input. A leading minus sign is not allowed.

convert-length (optional, number): minimum displayed length 1 through 32, default 1. Shorter converted values receive leading zeros when requested. This parameter does not change the decimal value: 0087 and 87 represent the same quantity.

Argument order matters: the source value or string goes first; the optional minimum displayed width goes second. Apple’s help uses commas in these English examples. The width argument is optional; do not include an empty comma if you are using the default. Apple OCT2DEC definition (checked 2026-10-13).

What counts as a valid source string?

Apple’s engineering function article governs this function specifically, rather than Excel’s rules. In the example worksheets, source entries are explicitly Text. Do not assume that a numeral copied from a PDF is automatically the same representation as a text value after parsing. If a workbook uses a locale-specific argument separator, insert the function from Numbers’ function browser and follow the local syntax instead of blindly copying the English comma. Apple argument types; Apple cell references (checked 2026-10-13).

Reproducible workbook: copy these inputs into a Numbers table

  1. In a new Numbers spreadsheet, add a table named Conversions (you can keep the default name). Put Source as text in A1, Formula in B1 and Expected display in C1.
  2. Format column A as Text before entering the source digits. Copy the values in the second column of the following table into A2 onward. The source is not a spreadsheet formula.
  3. In B2 onward, enter each displayed formula below. A Numbers cell should contain the formula, not its literal string representation. Compare the displayed answer to C’s expected value.
  4. Where a value includes leading zeros, inspect the destination cell’s display formatting; retain the source and output as text when exporting identification strings. This test plan was authored but not run natively.
Cell in A Enter as Text in A Formula to put in column B Expected displayed result Independent place-value check
A2 127 =OCT2DEC(A2,4) 0087 1×64 + 2×8 + 7 = 87
A3 15 =OCT2DEC(A3) 13 1×8 + 5 = 13
A4 777 =OCT2DEC(A4) 511 7×64 + 7×8 + 7 = 511
A5 755 =OCT2DEC(A5) 493 7×64 + 5×8 + 5 = 493
A6 0 =OCT2DEC(A6) 0 Zero
A7 10 =OCT2DEC(A7) 8 1×8 + 0 = 8

The expected results were checked using independent integer-base conversion. Apple-published examples are called out separately below. Do not treat this as a native Numbers test log. Apple OCT2DEC article (checked 2026-10-13).

Apple’s directly documented examples

Apple’s formula Apple’s displayed result Verification source
=OCT2DEC(127,4) 0087 Apple-published padded example
=OCT2DEC(15) 13 Apple-published example
=OCT2DEC(-127,4) an error Apple explicitly says minus sign not permitted

Practical and advanced uses

Verify the conversion by place value

For octal 755, calculate 7×8² + 5×8¹ + 5×8⁰ = 448+40+5 = 493. That independently checks the expected =OCT2DEC("755") result, without executing Numbers. An intermediate step like this is useful when verifying imported system configuration tables.

Convert several rows without losing meaning

Put octal values 127, 15, 777, 755, 0, 10 in Text cells A2:A7. In B2 enter =OCT2DEC(A2) and fill down. The expected outputs are 87, 13, 511, 493, 0, 8. For padded display use =OCT2DEC(A2,4) to request four characters. Treat the padded result as text for interchange when leading zeros are required; Apple documents the display padding but this guide has not verified exported data types.

Cross-check with base-8 formatting

=DEC2OCT(OCT2DEC("755")) is mathematically expected to yield 755. This is a reasonable candidate for a round-trip check, but the chained Numbers formula and its intermediate data-type coercion were not executed in Numbers. Test the exact workbook and version before treating it as a production validation.

Avoid comparing raw and converted strings

Text "755" should not be sorted against decimal number 493 as if they were the same base. Convert first, choose a consistent numeric or text representation for downstream comparisons, and document which base each column uses.

When not to use OCT2DEC: Use OCT2DEC to normalize documented octal values into decimal for counting and other arithmetic, while retaining original octal text in a separate source column for auditability.

Errors, limits and troubleshooting

Symptom Explanation Action
An input contains 8 or 9 Those are not valid octal digits. Reject or clean the source data before converting.
A negative octal example errors Apple explicitly forbids the minus sign. Do not infer DEC2OCT’s negative rules apply to OCT2DEC.
Padded output looks like 0087 instead of 87 convert-length pads with zeros; the decimal value is still 87. Separate display width from arithmetic semantics.
Unexpected error for width Legal optional width is 1–32. Check out-of-range, blank, and nonnumeric width; native error text unverified.
Imported input is numeric Leading zeros may already have been removed. Preserve octal source as Text when those characters matter.
Wrong result from a source field Data may have been decimal rather than octal. Confirm the source base before converting; digits alone don’t identify the base.

Limit of this research: Apple documents parameter types, width ranges and certain invalid characters. It does not supply a complete test matrix in the cited function article for blanks, decimals, very large values, regional parsing, and coercion of every cell type. Thus this guide neither invents exact error codes nor claims unsupported interoperability behaviour. Apple OCT2DEC help; Apple official formula-error review guidance (checked 2026-10-13).

Apple Numbers versions, platforms and other spreadsheet programs

Apple’s Formulas and Functions Help 15.4 contains an entry for OCT2DEC and the argument order and limits stated above. Apple’s current Numbers for Mac User Guide identifies version 15.4, and its Mac release history describes features in that release. Apple also documents Numbers 15.4 for iPhone in its iPhone release history. Those release pages establish software/documentation version context; they do not constitute a test of the function on Mac, iPad, iPhone, or Numbers for iCloud. The function browser, locale and availability on each older release remain not independently verified. Mac guide; Apple 15.4 function article (checked 2026-10-13).

Excel, Google Sheets, LibreOffice and other spreadsheets may provide similarly named engineering functions with different width limits, signed-number conventions, string coercion or errors. This guide makes no cross-product parity claim because no external spreadsheet execution was used as Numbers evidence. If transferring an Excel file, verify the formulas and output in Numbers itself before relying on critical reports.

Locale and table-reference guidance

For English-language Numbers help the argument separator shown is a comma. Locale settings can affect punctuation and decimal separators; do not infer your installed syntax from English screenshots. Apple recommends referencing cells in tables using the formula editor; when a source is on a separate sheet/table, select that cell to insert the proper reference rather than typing an unverified table qualifier. Apple argument types; Apple table references (checked 2026-10-13).

The related functions below belong to Apple’s official Engineering catalogue. All are linked to Apple’s real, version-specific help pages, for readers who want to compare the specifications:

Apple’s function category catalogue lists these functions. Checked on 2026-10-13.

Frequently asked questions

What is octal 127 in decimal?

87, because 1×64 + 2×8 + 7 = 87.

Why does the formula show 0087?

The optional width of 4 pads 87 with two leading zeros; Apple publishes that exact example.

Can I use negative octal values?

No. Apple explicitly documents an error when a minus sign is present in OCT2DEC.

Official source notes and verification ledger

  • [S1] Function identity, signature, accepted digits/strings, optional width and Apple examples: Apple OCT2DEC — Formulas and Functions Help 15.4 (accessed 2026-10-13 UTC). Claims in the syntax, example, and troubleshooting sections derive from this page.
  • [S2] Cell and argument types: Apple Types of arguments and values and Refer to cells in formulas (accessed 2026-10-13 UTC). These support table/argument terminology, not application execution.
  • [S3] Catalogue and versions: Apple function catalogue, Numbers for Mac 15.4 user guide and Mac version history (accessed 2026-10-13 UTC). These support the official current documentation/release identification, not full historical availability.
  • [S4] Mathematics: examples were independently evaluated via integer-base arithmetic on 2026-10-13; this is not a Numbers computation.
  • [S5] Native Apple Numbers execution, screenshots, import/export and cross-device behavior: Not tested.