Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Logic lab

Truth tables for any propositional formula, tautology checks, the shortest equivalent forms, equivalence with a counterexample, and whether an argument is valid.

How to use

  1. Type a formula with variables (letters or short words) and the connectives not, and, xor, or, implies and iff. You can also type ! & ^ | -> <-> or the symbols ¬ ∧ ⊕ ∨ → ↔, and 1 or 0 for true and false.
  2. Truth table lists every combination (up to 6 variables), says whether the formula is always true, never true or depends, and gives its shortest form.
  3. Same or different? checks whether two formulas always agree and shows a row where they do not.
  4. Is the argument valid? checks whether the conclusion must be true whenever all the premises are, and shows a counterexample if not.

Keyboard and touch

TabMove between tabs, boxes and buttons
Enter in a boxRun the check

Tips

  • Binding order, strongest first: not, and, xor, or, implies, iff. So "a or b and c" means a or (b and c). Use brackets when in doubt.
  • "p implies q" is false only when p is true and q is false.
  • The default argument (if it rains the ground is wet; the ground is wet; so it rained) is a classic mistake called affirming the consequent.
  • The shortest OR of ANDs is what a Karnaugh map gives: useful for logic circuits.

About the lab

Formulas are read by our own parser, with implies grouping from the right. Truth tables list rows in counting order with the first variable (alphabetically) changing slowest. The shortest forms use the Quine-McCluskey method (1952-1956) to find every prime implicant, then search all combinations for the fewest terms, and then the fewest letters (very hard formulas stop after a fixed search and show the best found). Equivalence and validity are decided by checking every row, which is exact for propositional logic. Everything runs in your browser.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product