⚑ Truth Table Generator

Every input combination, every output. Logic made visible.

-

How to Use the Truth Table Generator

Pick a logical operation and the number of inputs. The full truth table appears with a plain-English reading of each gate.

1

Choose the operation: AND, OR, NOT, XOR, NAND, NOR, XNOR, or implication.

2

Choose 2 or 3 inputs. (NOT uses one input; extra columns show it repeated.)

3

Read each row: the inputs on the left, the output on the right.

The Eight Operations

AND: true only if all inputs are true. Series switches: every switch must close. OR: true if any input is true. Parallel switches. NOT: flips one input. XOR: true when inputs differ; the "one or the other but not both" gate, basis of binary addition. NAND: AND then flipped; universal gate. NOR: OR then flipped; also universal. XNOR: true when inputs match; an equality detector. Implication: false only for true→false; equivalent to (NOT P) OR Q.

De Morgan's Laws

The two most useful equivalences in logic, verifiable row by row in the tables: NOT (P AND Q) = (NOT P) OR (NOT Q), and NOT (P OR Q) = (NOT P) AND (NOT Q). In words: to negate a conjunction, negate each part and flip AND to OR. Engineers use these to convert circuits to NAND-only implementations; programmers use them to simplify negated conditions: !(a && b) becomes !a || !b.

Reading Tautologies and Contradictions

A column that is all true is a tautology (P OR NOT P); all false is a contradiction (P AND NOT P). Spotting these in compound expressions tells you when a condition can be simplified away entirely. If your 3-input table shows an output column of all trues, that sub-expression is dead weight: delete it and the logic is unchanged.

Frequently Asked Questions

What is a truth table?

A truth table lists every possible combination of true/false inputs and the resulting output of a logical operation. For 2 inputs there are 4 rows; for 3 inputs, 8 rows. It is the complete definition of a logic gate or boolean expression, leaving no case unexamined.

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

AND is true only when both inputs are true. OR is true when at least one is true. XOR (exclusive or) is true when exactly one is true, but false when both are. The everyday "or" is often XOR ("soup or salad"), while logic's OR is inclusive.

What are NAND and NOR gates?

NAND is AND followed by NOT: false only when both inputs are true. NOR is OR followed by NOT: true only when both are false. They matter because NAND alone (or NOR alone) can build every other gate, so entire CPUs are manufactured from one repeated gate type.

What is logical implication (P β†’ Q)?

P β†’ Q is false only when P is true and Q is false; otherwise true. It feels odd that "false implies anything" is true, but it matches "if P then Q" making no claim when P is false. It is equivalent to (NOT P) OR Q, which the table confirms.

Where are truth tables used?

Digital circuit design (every chip), programming conditionals, database queries (AND/OR/NOT filters), and mathematical proofs. De Morgan's laws, which the tables verify, let engineers swap AND/OR configurations to use cheaper gates.