Boolean Algebra Calculator

Type an expression using the letters A to Z as variables.

Use AND, OR, NOT, XOR, NAND, NOR, XNOR or the symbols &, !, ^ and the vertical bar, with brackets. Up to 5 variables, each a single letter.

This result is an estimate only. Double-check important figures before relying on them.

How it is calculated

  • Every combination of the variables is tried in binary order
  • NOT binds tightest, then AND/NAND, then XOR/XNOR, then OR/NOR
  • True rows are listed as minterms m0, m1, m2 and so on

For logic with numbers, use the number base converter.

Worked example

A AND B:

  • Rows 00, 01, 10, 11 give 0, 0, 0, 1
  • True only for m3, so it is contingent

Why your number may differ

Letters are always single-character variables, so a name such as AB means A followed by B and is rejected. Reduce to simplest form is not included.

Frequently asked questions

What is a truth table?

A list of every combination of the variables with the result of the expression for each. With n variables there are 2ⁿ rows.

What is a minterm?

The number of a row where the expression is true, counting the variables as binary digits with the first letter as the highest bit.

What is the operator order?

NOT first, then AND and NAND, then XOR and XNOR, then OR and NOR. Use brackets to be sure.