Skip to content
Toolcroft

Math Calculators

Truth Table Generator

Generate truth tables for any Boolean expression using variables A–Z and operators AND, OR, NOT, XOR, NAND, NOR, XNOR with parentheses.

Operators: AND, OR, NOT, XOR, NAND, NOR, XNOR. Variables: A–Z.

ABResult
000
010
100
111

Boolean operator reference

OperatorSymbol(s)MeaningTrue when…
AND∧ or &&ConjunctionBoth operands are true
OR∨ or ||DisjunctionAt least one operand is true
NOT¬ or !NegationThe operand is false
XOR⊕ or ^Exclusive orExactly one operand is true
NAND↑ (Sheffer stroke)Not ANDAt least one operand is false
NOR↓ (Peirce arrow)Not ORBoth operands are false
Implication-> or ⋒If…thenAntecedent is false, or consequent is true
Biconditional↔ or ⇔If and only ifBoth operands have the same truth value

Operator precedence (highest to lowest)

  1. ¬ (NOT)
  2. ∧ (AND)
  3. ∨ (OR)
  4. ⊕ (XOR)
  5. -> (Implication)
  6. ↔ (Biconditional)

Use parentheses to override precedence and make complex expressions unambiguous.

How to read a truth table

A truth table lists every possible combination of true (T) and false (F) values for the input variables, then shows the output for each combination. With n variables, there are 2ⁿ rows.

Example: evaluate (A AND B) OR NOT C for A=T, B=F, C=T:

  1. Evaluate innermost / highest-precedence first: NOT C = NOT T = F
  2. Evaluate AND: A AND B = T AND F = F
  3. Evaluate OR: F OR F = F

The full table would have 2³ = 8 rows, one for each combination of A, B, and C. Read each row independently, following the same step-by-step precedence order.

Logic gates and digital circuits

Boolean logic is the foundation of digital electronics. Each operator corresponds to a logic gate that can be implemented in hardware:

GateSymbolBoolean operatorRole in circuits
AND gateA AND BOutput high only when all inputs high
OR gateA OR BOutput high when any input high
NOT gate (inverter)¬NOT AFlips the signal
NAND gateNOT (A AND B)Universal gate - any circuit can be built from NAND alone
NOR gateNOT (A OR B)Also universal
XOR gateA XOR BUsed in adders and error detection (parity)

Tautologies and contradictions

Some logical expressions have a fixed truth value regardless of the inputs:

  • Tautology: always true. Example: A OR NOT A. No matter what A is, this is always T. Used to prove logical completeness.
  • Contradiction: always false. Example: A AND NOT A. A cannot be both true and false simultaneously.
  • Contingency: everything else - sometimes true, sometimes false depending on input values. Most real-world logic expressions are contingencies.

If the generated truth table has all T in the output column, the expression is a tautology. All F means a contradiction.