Toolvito

Works on this device

Boolean Logic Calculator

Type a Boolean expression such as AB + A'C or p → q. The page reads it strictly, makes its truth table, works it out for given values, and checks whether two expressions are equal or an argument is valid.

Enter your values

Every row gives the variables one set of values and shows the output.

Your values

Use AND, OR, NOT, XOR (or · + ' ⊕). Letters side by side are joined by AND: AB means A AND B.

More options

Such as A B C. The first variable is the first bit of the row number. Leave it empty for alphabetical order.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Choose what you want: a truth table, the value for given inputs, an equivalence check, a tautology check, or an argument check.
  2. Type the expression. Use words (AND, OR, NOT, XOR) or signs (· + ' ⊕ or ∧ ∨ ¬). Letters side by side are joined by AND, so AB means A AND B.
  3. Choose Calculate. The page shows how it read your expression, so you can check the order of the operations.
  4. Under More options you can set the order of the variables and choose how expressions are written: textbook signs, logic signs or words.

Signs the page reads

Operators, from the first worked out to the last
Operation You can type Meaning
NOT NOT A, ¬A, ~A, !A, A' 1 when A is 0
AND A AND B, AB, A·B, A*B, A&B, A∧B 1 when both are 1
NAND A NAND B, A↑B NOT (A AND B)
XOR A XOR B, A⊕B 1 when the two differ
XNOR A XNOR B, A⊙B 1 when the two are the same
OR A OR B, A+B, A|B, A∨B 1 when at least one is 1
NOR A NOR B, A↓B NOT (A OR B)
Implies A → B, A -> B, A => B, A IMPLIES B 0 only when A is 1 and B is 0
If and only if A ↔ B, A <-> B, A <=> B, A IFF B 1 when the two are the same
  • Constants are 0, 1, TRUE and FALSE. A name is one letter, with digits after it if you want (x1). Small and capital letters are different names.
  • The sign ^ is not read, because it means AND in logic books and XOR in programming. A chain such as A NAND B NAND C or A → B → C needs brackets.
  • You can start with an output name, such as F = AB + C, or F(A, B, C) = AB + C to set the order of the variables.

Worked examples

  • AB + A'C with the variables A, B, C is 1 in rows 1, 3, 6 and 7: Σm(1, 3, 6, 7). Its complement by De Morgan's laws is (A' + B')(A + C').
  • AB + A'C and (A + C)(A' + B) give the same output in all 8 rows, so they are equivalent.
  • p → q and p, so q (modus ponens): the only row where both premises are 1 is p = 1, q = 1, and there q is 1. The argument is valid.
  • p OR NOT p is 1 in both rows, so it is a tautology.

Limits you should know

  • Truth tables are shown for up to 8 variables (256 rows). Equivalence, tautology and argument checks work for up to 16 variables (65,536 rows).
  • The page checks by going through every row. It does not write a proof with the laws of Boolean algebra.
  • For a short (minimal) form of an expression, use the Boolean Expression Simplifier. For circuits of gates, use the Logic Gate Calculator.

Related tools