DEC2OCT in Apple Numbers: Decimal to Octal Conversion and Leading Zeros
Convert decimal values to octal in Apple Numbers with DEC2OCT; learn padding, formula examples, negative-number caveats and troubleshooting.
Verification status: See the evidence and test scope described in this guide. 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.
Availability and version history
- Introduced: Documented in Apple’s Formulas and Functions Help 15.4; the original introduction release is not established.
- Availability: Currently documented for Numbers in that help version; it is not a final supported-version endpoint.
- Scope: Shared iWork function help. Availability in individual clients and older releases is not established by this check.
- Checked: October 14, 2026, against the official DEC2OCT reference. Documentation check; not a new native test.
Quick answer: what DEC2OCT does
DEC2OCT translates a base-10 value into its base-8 (octal) representation. It is useful when a specification, permissions table, or digital-system reference uses octal rather than everyday decimal numbering. It converts the representation, not the measured quantity: decimal 100 and octal 144 denote the same value.
Example: =DEC2OCT(100) → 144 (Apple’s documented expected display; not a native test). Apple official DEC2OCT help, v15.4 (checked 2026-10-13).
Syntax and arguments
=DEC2OCT(decimal-string, convert-length)
decimal-string (required, string representing a decimal integer): Apple describes a string made of decimal digits 0–9. Its official examples also pass a numeric literal such as 100, and separately demonstrate a negative numeric literal. Text-form inputs are clearest when feeding a reference cell; a leading sign is a special case discussed below.
convert-length (optional, number): minimum width 1 through 16. Default 1 when omitted. Shorter outputs are left-padded with 0 to reach the requested width; this is not a maximum length or a truncation setting.
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 DEC2OCT 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
- 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.
- 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.
- 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.
- 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 |
100 |
=DEC2OCT(A2) |
144 |
100 = 1×64 + 4×8 + 4 |
A3 |
1001 |
=DEC2OCT(A3,5) |
01751 |
1001 = 1×512 + 7×64 + 5×8 + 1 |
A4 |
64 |
=DEC2OCT(A4) |
100 |
64 = 1×8² |
A5 |
511 |
=DEC2OCT(A5) |
777 |
511 = 7×64 + 7×8 + 7 |
A6 |
0 |
=DEC2OCT(A6) |
0 |
Zero is still zero |
A7 |
493 |
=DEC2OCT(A7) |
755 |
493 = 7×64 + 5×8 + 5 |
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 DEC2OCT article (checked 2026-10-13).
Apple’s directly documented examples
| Apple’s formula | Apple’s displayed result | Verification source |
|---|---|---|
=DEC2OCT(100) |
144 | Apple-published example |
=DEC2OCT("1001",5) |
01751 | Apple-published padded example |
=DEC2OCT(-100) |
37777777634 | Apple-published negative example; inconsistent with Apple text about length |
Practical and advanced uses
A round-trip check for nonnegative inputs
Put decimal 493 in A7. =DEC2OCT(A7) has an independently calculated octal representation of 755. A companion cell can use =OCT2DEC(DEC2OCT(A7)) to express a round trip. The mathematical expected result is 493, provided both conversion results are accepted as input to the next function. Because this combination was not executed in Numbers, check coercion and display formatting in your installed version before depending on it for an automated workflow.
Fixed-width octal IDs
=DEC2OCT(1001,5) has expected displayed form 01751. Use this when you need five display positions in a catalogue or external interchange. Preserve the result as text if leading zeros are significant; do not assume a later numeric conversion retains them. This is a minimum-width formatter, not a way to limit the number of octal digits.
Converting an octal permissions example
A permissions mask often appears as octal 755, which corresponds to decimal 493. Formula =DEC2OCT(493) supplies the expected octal representation 755. Use this only as a number-base illustration, not as proof that changing a spreadsheet cell changes filesystem permissions.
Negative-number documentation warning
Apple states that DEC2OCT uses two’s-complement notation and that negative results have 12 digits, but its own =DEC2OCT(-100) example visibly returns 37777777634—11 characters, not 12. Independent arithmetic can explain this shown value as the octal representation of 2^32 − 100, yet that is not evidence of a general app bit-width guarantee. Do not add a zero or claim the note/output conflict is resolved. Treat negative values as pending native-version confirmation, and consult the current official article for any change.
When not to use DEC2OCT: The conversion is relevant to computing education, embedded-device tables, and numeric codes. For money, measurements, or general calculations, keep the decimal value for arithmetic and use octal only when the target protocol or standard expects it.
Errors, limits and troubleshooting
| Symptom | What to inspect | Evidence boundary |
|---|---|---|
| Result seems unchanged | Small decimals remain valid numbers but are written in base 8. For example, 7 → 7 whereas 8 → 10. | Independent base-8 arithmetic. |
| Leading zero vanishes | Text-versus-number formatting in the destination cell or downstream export. Preserve identifiers as text. | Display guidance, not an application test. |
| Formula reports an error for width | The official convert-length range is 1–16; check zero, negative values, and nonnumeric widths. |
Official documented parameter range; exact error text unknown. |
| Unexpected behaviour with negative input | Apple both documents two’s-complement negatives and contradicts itself on their digit count. | Unresolved official note versus example; native test needed. |
| Input includes decimals, spaces, currency symbols or stray text | Supply a valid decimal integer representation, not formatted currency or a fractional value. | Apple specifies decimal digit input; no untested implicit conversion is promised. |
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 DEC2OCT 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 DEC2OCT 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).
Related official functions
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:
- OCT2BIN: official Apple Functions Help 15.4 — neighbouring base-conversion direction.
- OCT2DEC: official Apple Functions Help 15.4 — neighbouring base-conversion direction.
- OCT2HEX: official Apple Functions Help 15.4 — neighbouring base-conversion direction.
Apple’s function category catalogue lists these functions. Checked on 2026-10-13.
Frequently asked questions
Is DEC2OCT an octal-to-decimal function?
No. DEC2OCT takes base-10 input and produces a base-8 representation. Use OCT2DEC for the reverse.
Does the optional second argument set the number of decimals?
No; it sets a minimum character width and pads on the left with zeroes.
Can I trust the negative-number length?
Do not infer it from the current help note: Apple publishes an 11-character negative example but says 12 digits. Check the negative-value case in the Numbers version you use.
Official source notes and verification ledger
- [S1] Function identity, signature, accepted digits/strings, optional width and Apple examples: Apple
DEC2OCT— 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.