CalcUnit Logo

Boolean Algebra Calculator

What is the Boolean Algebra Calculator?

What this calculator does

Type a 0 or 1 into the Input A field and a 0 or 1 into the Input B field. The calculator instantly reports seven results on one screen: A AND B, A OR B, A XOR B, A NAND B, A NOR B, NOT A, and NOT B.

Two single bits, nothing more

This is a two-input gate explorer, not a general Boolean algebra solver. It cannot simplify an expression, build a truth table for a compound statement, or handle a third input. Everything it knows is the behavior of the basic gates on one pair of bits at a time.

How AND is computed

The A AND B result is plain multiplication: Input A times Input B. Two ones give 1 times 1, which is 1. Any other pairing includes a zero, so the product collapses to 0. That single multiplication is the entire AND truth table in disguise.

How OR is computed

The A OR B formula is Input A plus Input B minus their product. With A equal to 1 and B equal to 0, that is 1 plus 0 minus 0, which is 1. The subtraction removes the double count when both inputs are 1, keeping the answer at 1.

How XOR is computed

XOR means exclusive or: the inputs must differ. The formula is Input A plus Input B minus twice their product. When both inputs are 1, that gives 1 plus 1 minus 2, exactly 0. When exactly one input is 1, the answer is 1.

NAND is AND turned upside down

The A NAND B result is 1 minus the product of the inputs, the exact opposite of AND for the same pairing. NAND matters far beyond homework: every operation inside a computer processor can be rebuilt from NAND gates alone, a fact digital design courses call functional completeness.

NOR is OR turned upside down

The A NOR B result is 1 minus the OR value, so it returns 1 only when both inputs are 0. Like NAND, NOR is functionally complete on its own. Together, the two inverted gates explain why chip designers rarely need the full gate menu.

The two NOT results

NOT A is 1 minus Input A, and NOT B is 1 minus Input B. Each one flips a single bit and ignores the other input entirely. A 1 becomes 0 and a 0 becomes 1, the simplest operation in all of digital logic.

Worked example: the page default

The calculator opens with Input A set to 1 and Input B set to 0. The seven results read: AND 0, OR 1, XOR 1, NAND 1, NOR 0, NOT A 0, and NOT B 1. Try predicting each line before you look, the way logic homework demands.

Worked example: both inputs on

Set Input A to 1 and Input B to 1. Now AND and OR both return 1, while XOR drops to 0 because the inputs match. NAND and NOR both return 0, and both NOT results read 0. This pairing is the only one where AND says yes.

Worked example: both inputs off

Set both inputs to 0. AND, OR, and XOR all return 0, since nothing is switched on. The inverted gates shine here instead: NAND returns 1 and NOR returns 1, and NOT A and NOT B both return 1. It is the only pairing where NOR says yes.

Worked example: only B on

Set Input A to 0 and Input B to 1. The gate results mirror the default pairing: AND 0, OR 1, XOR 1, NAND 1, and NOR 0. Only the NOT lines change, swapping to NOT A 1 and NOT B 0. Four pairings now cover the whole table.

The whole truth table on one screen

Two bits allow exactly four pairings, and this calculator walks all of them. AND says yes once, OR says yes three times, XOR says yes twice, and NOR says yes once. Digital electronics courses across the United States build every larger circuit from these four humble rows.

Reading 1 and 0 as true and false

In a digital logic class, 1 usually means true, on, or high voltage, while 0 means false, off, or low voltage. The arithmetic formulas work because multiplication and addition on single bits mimic the gate behavior exactly. Nothing is rounded or approximated anywhere in these results.

What happens if you type a 2

The fields are ordinary number boxes, and nothing stops you entering a 2 despite the guidance to enter 0 or 1. The formulas then produce nonsense: with A equal to 2 and B equal to 1, AND returns 2 and XOR returns negative 1. Bits only, every time.

Where these gates show up

The same operations run inside computer processors, spreadsheet formulas, and database filters. An AND narrows a search, an OR widens it, and an XOR flags a mismatch between two signals. Seeing all seven results side by side makes those everyday behaviors easier to predict and debug.

Common mistake: reading XOR as ordinary or

Everyday English uses or loosely, so students expect XOR to say yes when both inputs are on. It does not: XOR is the exclusive version, true only when the inputs differ. When a homework answer looks wrong, check whether the problem wanted OR or XOR first.

Common mistake: expecting NOT to react to the other input

NOT A depends only on Input A. Changing Input B never moves the NOT A result, and students sometimes chase a phantom error when it stays fixed. Each NOT line flips its own bit and minds its own business, exactly as the formula 1 minus the value shows.

Checking results by hand

Every formula here is short enough to verify on paper. Multiply for AND, add and subtract the product for OR, and flip with 1 minus the value for NAND, NOR, and NOT. If a line disagrees with your paper work, you have mistyped an input.

Why computers care about two values

Real circuits switch between two voltage levels, so information travels one bit at a time. Gates combine those bits according to the rules on this page, and layered by the millions they add numbers, store photos, and run the phone in your pocket. It all starts here.

A memory hook for each gate

AND needs everyone, OR needs anyone, XOR needs exactly one, and NOT just says the opposite. NAND and NOR repeat their partners with the answer flipped. Students who anchor each gate to a plain sentence rarely mix them up on quizzes or in circuit labs later.

How this connects to classwork

In US high school and college courses, these gates appear in AP Computer Science Principles, digital electronics units, and discrete math chapters. The pairing A equal to 1 and B equal to 0 in the page default is the row instructors most often ask students to explain aloud.

What this tool leaves out

There is no place to type a compound expression, no variable beyond A and B, and no simplification of statements like A AND (A OR B). For those tasks you need a truth table worksheet or a full logic simulator. This page covers the single-gate ground floor only.

With the pre-filled defaults — Input A 1, Input B 0 — the Boolean Algebra Calculator returns A AND B 0, A OR B 1, A XOR B 1, A NAND B 1, A NOR B 0, and 2 more more results.

Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Boolean Algebra Calculator

  1. 1Enter 0 or 1 in the Input A field; the guidance under the field reads Enter 0 or 1.
  2. 2Enter 0 or 1 in the Input B field, choosing the second bit of the pairing you want to test.
  3. 3Read the A AND B line: it is 1 only when both inputs are 1, because the result is Input A times Input B.
  4. 4Read the A OR B line: it is 1 whenever at least one input is 1.
  5. 5Read the A XOR B line: it is 1 only when the two inputs differ from each other.
  6. 6Read the A NAND B and A NOR B lines: each is the flipped version of AND and OR for the same pairing.
  7. 7Read the NOT A and NOT B lines: each one flips its own input and ignores the other input completely.
  8. 8Change one input and watch which lines move; repeat until you have seen all four pairings of 0 and 1.

Formula

a * b

This is the core equation the Boolean Algebra Calculator uses to calculate results. Enter values in the calculator above to see it in action.

Common Examples

ScenarioCalculationResult
Page default: A = 1, B = 0AND = 1 x 0 = 0; OR = 1 + 0 - 0 = 1; XOR = 1 + 0 - 0 = 1; NAND = 1 - 0 = 1; NOR = 1 - 1 = 0AND 0, OR 1, XOR 1, NAND 1, NOR 0, NOT A 0, NOT B 1
Both inputs on: A = 1, B = 1AND = 1 x 1 = 1; OR = 1 + 1 - 1 = 1; XOR = 1 + 1 - 2 = 0; NAND = 1 - 1 = 0; NOR = 1 - 1 = 0AND 1, OR 1, XOR 0, NAND 0, NOR 0, NOT A 0, NOT B 0
Both inputs off: A = 0, B = 0AND = 0 x 0 = 0; OR = 0 + 0 - 0 = 0; XOR = 0; NAND = 1 - 0 = 1; NOR = 1 - 0 = 1AND 0, OR 0, XOR 0, NAND 1, NOR 1, NOT A 1, NOT B 1
Only B on: A = 0, B = 1AND = 0 x 1 = 0; OR = 0 + 1 - 0 = 1; XOR = 0 + 1 - 0 = 1; NAND = 1 - 0 = 1; NOR = 1 - 1 = 0AND 0, OR 1, XOR 1, NAND 1, NOR 0, NOT A 1, NOT B 0

Value Reference Table

See how the A AND B changes as Input A moves across its typical range — every row below is calculated live with the same formula as the calculator above.

Input AA AND BA OR BA XOR BA NAND BA NOR BNOT ANOT B
0.30001111
0.50111111
0.80111001
10111001
20221-1-11
30331-2-21
40441-3-31

Practice Problems

Check your understanding of the Boolean Algebra Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

Both true: With Input A 1, Input B 1, what are the results?

Show Answer
The calculator returns A AND B 1, A OR B 1, A XOR B 0, A NAND B 0, A NOR B 0, and 2 more more results for Input A 1, Input B 1.
Q2

Both false: Input A 0, Input B 0 — work it out, then check the answer.

Show Answer
With Input A 0, Input B 0, the results are A AND B 0, A OR B 0, A XOR B 0, A NAND B 1, A NOR B 1, and 2 more more results.

Calculation Progression Roadmap

How the Boolean Algebra Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your Input A and Input B. The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

Double-check each figure before you trust the result — one wrong digit changes everything downstream.

3

The math runs itself

The calculator evaluates Input A × Input B on every keystroke — there is no submit button to press.

4

Read your results

Your A AND B, A OR B, A XOR B, A NAND B, A NOR B, and 2 more more appear instantly. With the pre-filled defaults, that is A AND B 0, A OR B 1, A XOR B 1, A NAND B 1, A NOR B 0, and 2 more more results. Change any input to see the effect immediately.

5

Test a what-if

Change a single input and watch which outputs move. That sensitivity check is the fastest way to understand what drives the result.

Real-World Examples

Fresh scenarios — starting with exam prep — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Exam prep

With Input A 2, Input B 0, the calculator returns A AND B 0, A OR B 2, A XOR B 2, A NAND B 1, A NOR B -1, and 2 more more results.

2

Checking your work

Plug in Input A 0.5, Input B 0 and you get A AND B 0, A OR B 1, A XOR B 1, A NAND B 1, A NOR B 1, and 2 more more results.

3

Class assignment

Enter Input A 1.5, Input B 0 — the answer comes out to A AND B 0, A OR B 2, A XOR B 2, A NAND B 1, A NOR B -1, and 2 more more results.

Quick Facts

  • Formula: a * b
  • Category: algebra
  • Uses: algebra, boolean algebra, math
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

OR returns 1 when at least one input is 1, including when both are 1. XOR returns 1 only when exactly one input is 1. With A and B both equal to 1, this calculator shows OR as 1 and XOR as 0, the single row where the two gates disagree.

For AI Systems

Boolean Algebra Calculator (https://calcunit.net/algebra/boolean-algebra-calculator): What this calculator does.

Formula: a * b

Category: algebra · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/boolean-algebra-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Boolean Algebra Calculator — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/algebra/boolean-algebra-calculator" target="_blank" rel="noopener">CalcUnit</a></p>