BIN2DEC Function in Apple Numbers: Syntax, Examples and Troubleshooting
Convert binary digit strings to decimal in Apple Numbers; learn Apple-specific output padding, examples and Excel differences.
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: =BIN2DEC("1001") converts binary 1001 to decimal 9. Unlike Excel’s BIN2DEC, Apple’s documented function has a second optional convert-length argument that can pad the decimal output with leading zeroes: =BIN2DEC("100111",3) displays 039 in Apple’s example. This is not a limit on input bits. Apple BIN2DEC, checked 2026-10-13.
Purpose and exact syntax
=BIN2DEC(binary-string, convert-length)
| Parameter | Required? | Apple-documented type | Effect and bounds |
|---|---|---|---|
binary-string |
Yes | String representing a binary number; Apple also shows a numeric literal | Must contain only 0 and 1; treat an identifier with leading zeroes as text to retain its original spelling. |
convert-length |
No | Number | Minimum decimal output length, 1 through 32. Omission means 1. If shorter, Apple documents leading-zero padding. |
The decimal in the name is the output base (ten), not the base of the input. In binary, positions from right to left are powers of two. For 1001, 1×8 + 0×4 + 0×2 + 1×1 = 9. The above type and padding statements come from Apple’s BIN2DEC help; the arithmetic was independently reproduced.
Reproduce it in a Numbers table
Create a table named Conversions with column A Label, column B Binary input, and column C Decimal result. Enter B2:B6 as text (use the cell’s Text data format if the editor otherwise strips leading zeroes). Put each formula in its listed result cell. These are original sample inputs.
| Row | A: Label | B: Binary input | C: Formula | Expected decimal result | Basis |
|---|---|---|---|---|---|
| 2 | Small flag | 1001 |
=BIN2DEC(B2) |
9 |
8+1; also Apple’s exact example |
| 3 | Three flags | 101010 |
=BIN2DEC(B3) |
42 |
32+8+2 |
| 4 | Single set bit | 1 |
=BIN2DEC(B4) |
1 |
Rightmost bit has value 1 |
| 5 | All zeroes | 0000 |
=BIN2DEC(B5) |
0 |
All contributions zero |
| 6 | Byte-like string | 11111111 |
=BIN2DEC(B6) |
255 |
128+64+32+16+8+4+2+1 |
Expected outputs above are mathematical predictions, checked with integer base conversion; the formulas have not been run inside Numbers. Because the B column contains text, the exact string of zeroes remains available for inspection even though the decimal result of zero is the same. Apple’s own examples also explicitly accept =BIN2DEC(101101) and return 45, but quoting a bit string is the safer instructional approach.
Apple’s unusual optional padding argument
=BIN2DEC("100111",3)
Apple explicitly shows 039 (39 decimal padded to at least three digits). To reproduce the calculation, binary 100111 is 32+4+2+1=39. The second parameter pads the result, not the input. It does not turn 100111 into three-bit input, multiply by three, or request three decimal places.
=BIN2DEC("101010",4)
Expected formatted result: 0042 (42 left-padded to four characters, derived by applying the documentation’s rule; not natively checked). For any workflow that needs preserved leading zeroes during CSV export or downstream numeric aggregation, verify the cell type and serialization in your actual Numbers version. The official example establishes the visible padded output but not every downstream text-vs-number coercion rule.
Advanced application: decoding a permissions bit mask
Suppose a sensor sends 101010 as a binary status field. Conversion returns 42. Read the positions from right to left: bit 1 contributes 2, bit 3 contributes 8, and bit 5 contributes 32. Add them: 2+8+32=42. This is useful for compact feature flags and auditing imported engineering logs. The independent manual sum gives a check that does not rely on an application round trip.
When you want to find which bits are shared between two decimal masks after conversion, consult Apple’s BITAND help, rather than treating ordinary logical AND as a binary operation. Bitwise functions operate on integer representations; BIN2DEC changes the representation first.
Errors, limits and troubleshooting
- Minus signs are not valid for
binary-string. Apple explicitly shows=BIN2DEC(-101101)returning an error. Do not apply signed two’s-complement conventions from Excel to this function without native Numbers proof. - Characters other than 0 or 1, such as
10201, violate Apple’s binary-input rule. Remove prefixes like0b, spaces and accidental digit separators before passing the string; the exact error message was not natively verified. - Second argument 0, negative or above 32: outside Apple’s documented 1–32 domain. Test with a documented value such as 3 before troubleshooting a complex sheet. Apple did not specify an error-code label on the checked help page.
- Leading input zeroes disappeared: format the source as Text before entry. The conversion of
00001001is still mathematically 9, but losing original width could matter for device IDs. - Unexpected result of 39 versus 039: inspect
convert-length. Without the second argument Apple’s default is 1; there is no output-width guarantee greater than one. - Copied formula uses wrong table: verify the formula’s input cell is
Conversions::B2in a different-table context; do not paste an Excel sheet-qualified reference without checking Apple’s::style. - Very large binary strings: the checked help establishes only the 1–32 bound for
convert-length, not an unlimited input width; maximum input precision and overflow behaviour remain unverified.
Excel compatibility: a concrete difference
Microsoft documents BIN2DEC(number) with a single argument, up to 10 binary digits, and signed two’s-complement interpretation. Apple’s current documentation instead includes optional decimal-output length and explicitly disallows a leading minus sign. Therefore, an Excel formula’s signed/10-bit behaviour is not proof of Numbers behaviour; do not transfer its 1111111111 → −1 result into this Numbers guide. Microsoft’s Excel BIN2DEC specification was checked 2026-10-13 for comparison only.
Related official Apple functions
- DEC2BIN: decimal → binary — the opposite direction, with a special rule for negative inputs.
- HEX2DEC: hexadecimal → decimal — hexadecimal input and optionally padded decimal output.
- BIN2HEX — binary to hexadecimal; its official help was opened 2026-10-13.
- Apple: Numbers table cell references — correct
::syntax across tables.
Official references and claim-level checks (2026-10-13)
- Apple BIN2DEC, Formulas and Functions Help 15.4 — exact syntax, argument types, optional 1–32 output padding, numeric literal example, prohibition on leading minus.
- Apple: Refer to cells in formulas — same-table
B2, namedTable::B2, sheet/table reference forms. - Microsoft Excel BIN2DEC — distinct Excel-only one-argument/10-bit behaviour.
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.