QiLing Tools

🔣Truth Table Generator - Boolean Expressions, DNF/CNF and Simplification

Truth tables come up constantly in discrete math, digital logic and programming. Type a logical expression and the tool builds the complete table instantly: variables are detected automatically (up to 8, i.e. 256 rows), and you can show a column for every sub-expression to follow the evaluation step by step. It classifies the formula as a tautology, a contradiction or satisfiable, lists the minterms Σm and maxterms ΠM, writes out the canonical DNF (sum of minterms) and CNF (product of maxterms), and uses the Quine–McCluskey algorithm to find a minimal sum of products and product of sums — the same result a Karnaugh map gives. Input is forgiving: symbols ∧ ∨ ¬ → ↔ ⊕, programmer style & | ! ~ -> <-> ^, keywords AND OR NOT XOR, and digital-logic notation like A'B + AB' all work. Switch to Equivalence to check whether two expressions are logically equivalent and see every counterexample.

Free · No sign-up · Runs in your browserLast updated:

Loading tool...

How to use Truth Table Generator

  1. 1Type an expression or pick one of the examples
  2. 2Choose whether to show sub-expression columns and 1/0 or T/F
  3. 3Read the table, classification, normal forms and simplified forms — or switch to Equivalence to compare two expressions

FAQ

Which operators are supported, and in what precedence?
NOT: ¬ ! ~ NOT or a postfix '; AND: ∧ & && · * AND; OR: ∨ | || + OR; XOR: ⊕ ^ XOR; implication: → -> =>; biconditional: ↔ <-> <=>; plus NAND ↑ and NOR ↓. Precedence from high to low is ¬ > ∧ > ⊕ > ∨ > → > ↔, and → is right-associative. Add parentheses whenever in doubt.
How are the canonical DNF and CNF built?
The canonical DNF ORs together one minterm for every row where the formula is true; the canonical CNF ANDs together one maxterm for every row where it is false. Rows are numbered as binary numbers in variable order, and both the Σm / ΠM index lists and the full formulas are shown.
Is the simplification the same as a Karnaugh map?
Yes. Quine–McCluskey is the tabular form of K-map simplification: it finds all prime implicants and then the smallest set that covers every minterm, which works reliably for up to 8 variables. The minimal CNF comes from simplifying the false rows. Minimal forms are not always unique; one of them is shown.
How do I check whether two expressions are equivalent?
Switch to Equivalence and enter expressions A and B. The variables of both are combined and every row is compared; if all match they are equivalent, otherwise the differing rows are highlighted and listed as counterexamples, along with whether A implies B and B implies A.