Bitwise & binary arithmetic
Two binary numbers in, every representation out.
MATH TOOL
Run AND, OR, XOR, addition, and subtraction on binary numbers — with the decimal and hexadecimal result shown beside every answer.
Two binary numbers in, every representation out.
Binary operations come in two flavors. Bitwise operations (AND, OR, XOR) compare the two numbers bit by bit: each column is decided on its own, with no carrying. Arithmetic (add, subtract) works like grade-school math in base 2, carrying 1s leftward exactly as you carry 10s in decimal. The calculator shows every answer in binary, decimal, and hex, so you can read whichever representation your task needs.
Take 1010 (decimal 10) and 1100 (decimal 12). AND keeps a 1 only where both columns are 1: 1∧1=1, 0∧1=0, 1∧0=0, 0∧0=0 → 1000 (decimal 8). OR keeps a 1 where either is 1 → 1110 (14). XOR keeps a 1 where they differ → 0110 (6). Adding: 1010 + 1100 = 10110 (22) — column by column with carries, just like decimal addition. Subtracting: 1100 − 1010 = 0010 (2).
| Output | Rule | What it means |
|---|---|---|
| AND | 1 ∧ 1 = 1, else 0 | Bitwise mask — keeps only the bits set in both numbers. |
| OR | 0 | 0 = 0, else 1 | Combines flags — a 1 survives from either side. |
| XOR | bits differ → 1 | Difference detector — 1 exactly where the inputs disagree. |
| Add | base-2 addition | Plain sum, with carries — the same answer as decimal addition. |
| Subtract | base-2 subtraction | Plain difference, with borrows. |
The math is exact — integers only, no rounding anywhere. Limits: inputs cap at 32 bits (bigger than 4 billion in decimal, far past any homework problem), and subtraction that goes negative shows the magnitude with a minus sign rather than two's-complement form, which is the clearer reading for learners. For shifting, masking with NOT, or base conversion, see the binary, hex & decimal chart.
Bright Side Kit. "Binary Operations Calculator." https://brightoolbox.com/binary-operations-calculator/ Accessed October 22, 2026.Column by column from the right, carrying like decimal: 1 + 1 = 10 (write 0, carry 1), 1 + 1 + 1 = 11 (write 1, carry 1). Example: 1010 + 1100 = 10110. The calculator above shows the work — try it and check each carry.
1000 (decimal 8). AND keeps a 1 only where both columns are 1: compare 1∧1, 0∧1, 1∧0, 0∧0 from left to right to get 1, 0, 0, 0.
All three compare bit by bit. AND gives 1 only when both bits are 1 (masking). OR gives 1 when either bit is 1 (combining). XOR gives 1 when the bits differ (toggling/difference). On 1010 and 1100 that is 1000, 1110, and 0110.
Like decimal subtraction with borrows: 0 − 1 needs a borrow, and 10 − 1 = 1. Example: 1100 − 1010 = 0010. A handy shortcut is adding the two's complement, but the calculator does plain borrowing so the steps stay visible.
Because hardware is simplest with two states: on/off, high/low voltage. Every number, letter, and pixel in your device is a pattern of bits underneath — which is why fluency with binary operations pays off in programming and electronics.
Add up the place values of the 1s: for 10110, that's 16 + 4 + 2 = 22 (places are 16, 8, 4, 2, 1 from the left). The calculator prints the decimal and hex beside every result so you never convert by hand unless you want to.
Three classic jobs: toggling bits (x XOR 1 flips x's lowest bit), comparing values (a XOR a = 0), and the old swap trick. It is also the core operation inside many encryption ciphers.