MATH TOOL

Binary Operations Calculator

Run AND, OR, XOR, addition, and subtraction on binary numbers — with the decimal and hexadecimal result shown beside every answer.

1

Bitwise & binary arithmetic

Two binary numbers in, every representation out.

Only 0s and 1s — up to 32 bits.

Only 0s and 1s — up to 32 bits.

Bitwise logic or plain binary arithmetic.

Result—Enter values above

Enter values to see the result.

Two kinds of binary math

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.

A worked example

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 · formula · meaning

OutputRuleWhat it means
AND1 ∧ 1 = 1, else 0Bitwise mask — keeps only the bits set in both numbers.
OR0 | 0 = 0, else 1Combines flags — a 1 survives from either side.
XORbits differ → 1Difference detector — 1 exactly where the inputs disagree.
Addbase-2 additionPlain sum, with carries — the same answer as decimal addition.
Subtractbase-2 subtractionPlain difference, with borrows.

Who uses this

  • Students: digital-logic and discrete-math homework — truth tables and binary arithmetic without the slip-ups.
  • Programmers: checking flag masks, permissions bits, and subnet math by hand before trusting the code.
  • Electronics hobbyists: working out register values and bit patterns for microcontrollers and LEDs.
  • Interview preppers: bit-manipulation questions reward people who can do AND/OR/XOR in their sleep.

Accuracy & limitations

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.

Cite this calculatorBright Side Kit. “Binary Operations Calculator.” brightoolbox.com, 2026.Bright Side Kit. "Binary Operations Calculator." https://brightoolbox.com/binary-operations-calculator/ Accessed October 22, 2026.
Embed this calculator

Paste this into any web page to embed the live calculator. The “Bright Side Kit” link below it must stay intact.

Frequently asked questions

How do you add binary numbers?

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.

What is 1010 AND 1100 in binary?

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.

What is the difference between AND, OR, and XOR?

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.

How do you subtract binary numbers?

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.

Why do computers use binary?

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.

How do I convert the binary answer to decimal?

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.

What does XOR do in programming?

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.