Contact

DEC2BIN Function in Apple Numbers: Syntax, Examples and Troubleshooting

Engineering Intermediate Apple Numbers

Convert decimal integers to binary with Apple Numbers DEC2BIN, padding and 32-bit negative examples.

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

Quick answer: =DEC2BIN(100) gives the binary digits 1100100; Apple also documents =DEC2BIN("1001",12) returning 001111101001. Most importantly, Apple’s documented negative-number example uses a 32-bit two’s-complement result, not Excel’s 10-bit result. Apple DEC2BIN, checked 2026-10-13.

Purpose, required inputs, defaults and syntax

=DEC2BIN(decimal-string, convert-length)
Argument Required? Documented value Rule
decimal-string Yes Decimal digit string (Apple’s argument metadata); numeric literals also appear in Apple’s examples Represents a base-10 integer. Apple describes digit characters 0–9 and separately demonstrates a negative numeric literal.
convert-length No Number from 1–32, default 1 Minimum binary-output width for nonnegative input, with leading zeroes if needed. Apple’s negative results are always 32 digits.

An output bit is a 1 when its corresponding power of two contributes to the number. 100 decimal = 64+32+4, so DEC2BIN(100) yields binary 1100100. Apple calls the first parameter a “string value” but supplies numeric examples DEC2BIN(100) and DEC2BIN(-100); this tutorial uses quoted decimal strings for imported IDs and numeric literals for explicit arithmetic.

Reproducible original sample table

Create Conversions, with header row 1 and columns A: Label, B: Decimal input and C: Binary result. Enter the values in B2:B7 as ordinary positive integers and paste each formula in the listed C cell, outside the inputs.

Row B: Decimal input Formula in C Expected binary digits Independent reasoning
2 5 =DEC2BIN(B2) 101 4+1
3 13 =DEC2BIN(B3) 1101 8+4+1
4 42 =DEC2BIN(B4) 101010 32+8+2
5 100 =DEC2BIN(B5) 1100100 64+32+4; matches Apple
6 0 =DEC2BIN(B6) 0 No bits set
7 255 =DEC2BIN(B7) 11111111 Sum of powers from 1 to 128

The expected digit sequences are independently calculated, not observations of a Numbers application run.

Set a minimum output width (without changing the value)

=DEC2BIN(13,8)

Expected: 00001101. Binary 13 is 1101, then it is padded to eight characters. Apple’s second argument specifies a minimum, not a maximum: a number requiring more digits is not documented here to be truncated to that width. If your integration insists on exactly eight bits, independently check the magnitude before relying on formatting.

=DEC2BIN("1001",12)

Apple’s published output: 001111101001. The first argument is decimal one thousand and one, not binary 1001; 1001 = 512 + 256 + 128 + 64 + 32 + 8 + 1, whose binary form is 1111101001 (ten digits), padded to twelve. Reproduce that sum or remove the first two zeros to check the result.

Advanced application: negative values and two’s complement

=DEC2BIN(-100)

Apple’s documented result: 11111111111111111111111110011100 (32 digits). The independent mathematical calculation represents negative 100 as 2^32 − 100 = 4,294,967,196 and then writes that unsigned quantity in 32 binary places. This agrees with Apple’s example; it is not a native Numbers execution. Apple’s help says negative results are always 32 digits. Do not treat the first 1 as a standalone minus sign: in two’s-complement encoding it participates in the fixed-width signed representation.

This is useful when comparing signed integer status words from device firmware, but only after you confirm that the device truly uses 32-bit two’s-complement storage. Applications using an 8-bit or 16-bit signed representation require an explicit, separate encoding design; merely changing convert-length is not a signed-width selector under the documented Numbers rule.

Round-trip calculation and correct base of input

For nonnegative examples, the mathematical inverse is BIN2DEC. Enter 13 in B3, use =DEC2BIN(B3) for 1101, then convert that binary text back with =BIN2DEC("1101") →13. Do not confuse the decimal digits 1001 with binary digits 1001: the former means 1001, the latter means 9. A run of a nested formula such as BIN2DEC(DEC2BIN(B3)) has not been natively tested for number/text coercion; use explicit text for an audited round trip.

Limits, errors and troubleshooting

  • Wrong input base: DEC2BIN treats 1001 as decimal 1001, not binary 9. Use BIN2DEC for an input already encoded in base two.
  • convert-length outside 1–32: outside Apple’s documented range. No specific error label was verified from the official page.
  • Misinterpreting negative results: Apple’s docs specify 32-bit two’s-complement, even if convert-length is supplied. Do not expect a 10-bit Excel-style negative value.
  • Non-digit text such as "13A": violates Apple’s decimal-digit requirement. Apple does not specify every coercion or validation error code in the cited function page.
  • Nonintegral inputs and very large magnitudes: the sampled documentation does not establish rounding, fractional-input handling or overflow/precision limits. Validate your actual workflow natively before accepting those values.
  • Leading zeroes disappear after export: keep binary output in a text-formatted destination and verify its CSV or other serialization. Apple’s function page establishes displayed characters, not every downstream type conversion.
  • Cross-table formula misreferences: the source data may be in Conversions::B2 when the formula lives elsewhere, per Apple’s documented reference grammar.
  • Formula delimiters differ by locale: the commas shown here come from English documentation; use the in-app editor to supply arguments if your region parses separators differently.

Excel and other spreadsheet differences

Excel documents DEC2BIN(number,[places]) but returns 10-character two’s-complement negatives, and imposes an Excel-specific valid input range of −512 through 511. Apple’s documented negative output is 32 bits and its optional output-length domain is 1–32. Do not assert Excel’s integer limits apply to Apple Numbers. Any Google Sheets or LibreOffice behaviour also requires its own primary documentation; it is not evidence for Apple’s internals. The tutorials deliberately do not claim native cross-platform execution.

Official references and claim-level checks (2026-10-13)

Apple Numbers table references and locale

For the example worksheets, add a table named Conversions with one header row, then place formulas in column C. When the formula is in that same table, a reference such as B2 targets B2 in Conversions. Apple officially documents cross-table references as Table Name::B2 and cross-sheet references as Sheet Name::Table Name::B2; let the Numbers editor build the exact reference for names containing spaces. The examples use the English-language comma separator and quoted text for digit strings. Other locale settings may change how formula arguments are separated. Rather than substituting a separator blindly, insert the function using your Numbers formula editor and confirm its argument prompts. Apple’s documented reference forms and formula editor instructions were checked 2026-10-13.

Compatibility and version evidence

These formulas are documented in Apple’s Formulas and Functions Help 15.4 on 2026-10-13. That establishes their current documented syntax, not the minimum Numbers version in which each function first became available. Apple’s help is a shared reference for iWork formula editing; it does not establish native results for every Mac, iPad, iPhone or iCloud edition. No version-specific performance or behavioural parity test was run for these guides. Formula portability must be checked against each destination program’s documentation and with representative values. Apple’s Numbers for Mac version history records new trigonometry, statistics and logic functions in 15.4; it does not say these three engineering converters first appeared then. Thus we do not assign them a 15.4 introduction date.

Verification and limitations

Documentation-checked, mathematical examples independently calculated, not executed in Apple Numbers. Padded results follow Apple’s published examples. No genuine Numbers screenshots or native error codes are claimed. The catalogue is not a guarantee of support in historical installations.