Contact

BITXOR Function in Apple Numbers: Bitwise XOR, Syntax and Worked Examples

Engineering Intermediate Apple Numbers

Reveal which binary flag positions differ between two integer values or toggle selected bits. Includes real worksheets, decimal and binary examples, common input problems and official Apple references.

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. =BITXOR(9,13) returns 4, as published in Apple’s Functions Help. A bit survives when the two input bits differ. Use this to detect changed flags or toggle a chosen set of flags. The result is a regular decimal number, not an automatically formatted binary string. [A1][M1]

All custom results below are expected outputs independently computed from integer bitwise arithmetic, not observed Apple Numbers screenshots. [V1]

Purpose: when should you use BITXOR?

A bit survives when the two input bits differ. Use this to detect changed flags or toggle a chosen set of flags. Bitwise operations process matching positions in the binary representations of two integers. A decimal value such as 13 is 1101 in base two, while 9 is 1001; the rightmost digit is the 1’s place, then 2, 4, 8, and so on. [A1]

Unlike Numbers’ logical AND or OR functions, BITXOR does not directly answer a multi-condition TRUE/FALSE question. It returns an integer built from bit positions. For examples in this guide, arguments are deliberately restricted to nonnegative integers whose binary representation is unambiguous. That is a conservative teaching choice, not a statement that Apple rejects all negative integers. [A1]

Exact official syntax and required arguments

=BITXOR(value-1, value-2)
Position Apple’s parameter Accepted value according to Apple Required?
1 value-1 First number; integer Yes
2 value-2 Second number; integer Yes

Apple shows two parameters, both required and integer-valued. Neither has a documented default. Swapping their order does not change the result. This English documentation uses a comma separator; the Portuguese (Brazil) edition of Apple’s BITOR article instead displays semicolons, demonstrating that examples can differ by locale. Follow the delimiter suggested by your own Numbers formula editor rather than copying punctuation blindly. [A1][L1]

Documentation/version scope: The source was Apple’s Formulas and Functions Help 15.4, accessed 2026-10-12, including its engineering-functions table of contents. This establishes that the English documentation lists BITXOR; it does not establish the minimum Numbers release that introduced this particular function or native test results across Mac, iPhone, iPad and iCloud versions. No synonym or alternate canonical function name was verified for BITXOR. [A1][A0][V1]

Single-bit truth table

Input bit A Input bit B BITXOR output bit
0 0 0
0 1 1
1 0 1
1 1 0

Apply the same rule independently to every matching binary position, then add the surviving powers of two to get the decimal result. The truth table is explicitly present in Apple’s function article. [A1]

Copyable examples from Apple’s documentation

Formula (English separator) Apple-documented result Why?
=BITXOR(9,13) 4 Binary 1001 and 1101 are compared position by position.
=BITXOR(12,3) 15 Binary 1100 and 0011 give the documented output.

These two results are observations from Apple’s published documentation, not execution by this research run. Independently computing the integer operation yields the same results. [A1][M1]

Reproduce six examples in one Apple Numbers table

Create a blank Numbers table called BitwisePractice with one header row. Put Input A in A1, Input B in B1, Expected output in C1, and Result in D1. Enter these pairs in A2:B7. The header labels are illustrative; the formulas use ordinary A1-style references, which Apple documents for cells in the same table. [R1]

A: Input A B: Input B Binary A (explanation only) Binary B (explanation only) C: Expected decimal result
9 13 00001001 00001101 4
12 3 00001100 00000011 15
5 3 00000101 00000011 6
0 8 00000000 00001000 8
10 6 00001010 00000110 12
255 15 11111111 00001111 240

In D2 enter:

=BITXOR(A2,B2)

Fill down to D7, or manually enter =BITXOR(A3,B3) through =BITXOR(A7,B7). Read the expected-result column above for comparison. The binary strings in the explanation columns are human-computed labels, not formulas to copy into Numbers. All six expected decimal outputs were calculated independently using Python’s integer ^ operator on nonnegative values; native Apple Numbers was not run. [M1][R1][V1]

Table-qualified references. If the formula is in a different table, Apple documents the pattern TableName::Cell, for instance:

=BITXOR(BitwisePractice::A2,BitwisePractice::B2)

If the cells are on another sheet, Apple’s guide additionally allows a SheetName::TableName::Cell form. When copying formulas in Numbers, check whether references are relative or absolute: Apple’s editor provides the $ notation for anchoring rows and columns. [R1]

Advanced use: compare versions or toggle flags

Model a settings field where individual permissions are encoded by 1, 2, 4, 8. Suppose the original value is 9 (1001) and a revised value is 13 (1101). The formula =BITXOR(9,13) returns 4 (0100): the value-4 bit changed. Shared bits do not appear in the result. This tells you what changed, not whether each change was an addition or removal; inspect the old and new values to determine the direction. [A1][M1]

Toggle a flag: If 5 (0101) currently has the value-4 flag, =BITXOR(5,4) is expected to return 1 (0001), switching that flag off. Applying the same toggle a second time restores the original value:

=BITXOR(BITXOR(5,4),4)

Expected: 5. This follows from the exclusive-OR truth table; it was independently checked in Python, not run in Numbers. [A1][M1]

Identical values and reversibility

BITXOR(x,x)=0 because every aligned bit is the same. BITXOR(x,0)=x. For nonnegative integers, BITXOR(BITXOR(x,y),y)=x. Try x=9, y=13: 9 XOR 13 = 4 and 4 XOR 13 = 9. Expected arithmetic; test natively before using the formula in production. [M1]

BITXOR is not the same as Apple’s logical XOR() (which concerns Boolean conditions). The bitwise function compares two integers, while the logical variant evaluates conditions. Treat any Excel or Google Sheets example as separate-platform guidance unless independently verified for Numbers. [A1]

Errors, inputs and limits: what is verified?

Symptom or question Evidence-based interpretation Safe troubleshooting step
A parameter is omitted, e.g. =BITXOR(9) Apple documents two required integers; this is outside its stated syntax. Exact Numbers error text was not tested. [A1] Supply both value-1 and value-2.
One argument is fractional, e.g. =BITXOR(2.5,1) An integer is required; a fraction does not meet that documented contract. Whether Numbers coerces or errors was not verified. [A1] Use actual whole-number inputs. Do not assume silent rounding.
One argument is quoted text, e.g. =BITXOR("9",13) Apple’s article calls for integers, not text. Conversion and error behaviour for numeric-looking strings were not tested. [A1] Enter a numeric cell or validate/convert input separately.
Empty cell or boolean TRUE/FALSE Apple’s function article does not establish coercion rules for these values. Test the exact case in Numbers; do not claim an automatic zero or one.
Negative integer, very large integer, or overflow Apple’s cited BITXOR page specifies integers but does not enumerate its signed-width or upper-limit rules. [A1] Avoid asserting Excel’s documented 2^48−1 ceiling applies to Numbers; perform a native boundary check before depending on such inputs.
Formula text rejected in a localized Numbers installation Argument delimiters vary in Apple regional documentation. [L1] Try the formula editor’s locale-appropriate separator, and check localized function spelling.
Output seems unlike a Boolean TRUE/FALSE BITXOR returns a numeric bitwise result, not a logical AND/OR truth value. [A1] Convert the result into a comparison only when that is your real task.

Do not present any presumed #NUM!, #VALUE!, signed width, precision cap or exact error wording as observed Numbers behaviour; these are outside the present native-testing evidence. [V1]

Compatibility: Apple Numbers versus Excel

Behaviour Apple Numbers 15.4 Functions Help Microsoft Excel’s own BIT documentation
Name and core operation BITXOR and bitwise exclusive OR (XOR) explicitly documented. [A1] BITXOR separately documented by Microsoft. [E1]
Argument count Two required integer parameters; no optional/default parameter. [A1] Two required numeric inputs; read Microsoft’s rules separately. [E1]
Argument order Apple explicitly says order does not affect the result. [A1] Bitwise operation on two values is mathematically commutative for these nonnegative integers. [M1]
Negative and oversized values No specific boundary behaviour established in the cited Apple BITXOR article. [A1] Microsoft documents a nonnegative, at-most-2^48−1 domain for this Excel function; this is Excel evidence only. [E1]
Locale or table references This guide uses Apple Numbers’ own syntax and Table::Cell convention. [R1][L1] Excel commonly uses a single-grid reference model; do not paste Numbers table-qualified identifiers into Excel unchanged.

This is intentionally a narrow compatibility claim: using the same English function name and elementary integer truth table does not prove that every error case, conversion rule, locale spelling or release-specific feature behaves identically. Excel’s limits are cited solely for Excel, never imposed on Apple Numbers. We did not verify Google Sheets, LibreOffice or other implementations of this function. [A1][E1][V1]

Sources, access dates, and validation provenance

  • [A1] Primary official function contract: Apple, BITXOR — Formulas and Functions Help 15.4, accessed 2026-10-12. Supports the description, exact two-argument syntax and integer type, commutativity, truth table and Apple’s two worked examples.
  • [A2] Related primary function contracts: Apple, BITAND, BITOR and BITXOR, accessed 2026-10-12. Used only for the named related operation and externally checked source links.
  • [A0] Catalogue presence and documentation scope: Apple’s function-list navigation includes the engineering-functions category in its table of contents; English 15.4 version path, checked 2026-10-12.
  • [R1] Apple references: Refer to cells in formulas, 15.4 edition, checked 2026-10-12. Supports A1-style, table-qualified and sheet-qualified references.
  • [L1] Locale: Apple BITOR, Portuguese (Brazil), accessed 2026-10-12, prints semicolons, contrasting the English comma notation. This establishes a real locale example, not exhaustive global locale rules.
  • [E1] Cross-compatibility (Excel only): Microsoft, BITXOR function, accessed 2026-10-12. Supports Excel syntax and Excel-specific numeric bounds; it cannot establish Numbers error handling.
  • [M1] Independent computation: Python’s exact nonnegative-integer ^ operator, run during manuscript creation; results in the tables and mathematical identities are expected, not app-observed.
  • [V1] Execution limitation: No native Numbers, Mac, iPhone/iPad, iCloud, or Excel runtime was available for execution. No native-application screenshots were captured.