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

> Free online truth table generator: enter a Boolean or propositional expression for the full table, tautology check, canonical DNF/CNF and Quine–McCluskey.

- URL: https://qilingtools.com/en/math/truth-table
- Category: Math Tools (https://qilingtools.com/en/math)
- Tags: [Math](https://qilingtools.com/en/tags/math), [Education](https://qilingtools.com/en/tags/education), [Developer](https://qilingtools.com/en/tags/dev), [Algorithms](https://qilingtools.com/en/tags/algorithm)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

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.

## How to use

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

## Features

- Automatic variable detection, up to 8 variables (256 rows)
- Optional column for every intermediate sub-expression
- Tautology, contradiction and satisfiability check
- Minterms Σm, maxterms ΠM, canonical DNF and CNF
- Minimal DNF and CNF via Quine–McCluskey
- Equivalence and implication check with counterexamples
- Symbols, keywords, programmer operators and A'B notation

## 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.

## Related tools

- [Graphing Calculator](https://qilingtools.com/en/math/graph): Free online function graphing calculator: type sin(x), x^2 or 1/x and see the curve at once, with several functions, parametric and polar curves, PNG export.
- [Scientific Calculator](https://qilingtools.com/en/math/calculator): Free online scientific calculator: type 2*(3+4)^2, sin(pi/6) or log(8,2) and see the answer as you type, with degrees or radians and a history list.
- [Equation Solver](https://qilingtools.com/en/math/equation): Free online equation solver: enter coefficients for linear, quadratic (with discriminant, vertex and complex roots) and cubic equations, plus 2×2 systems.
- [Fraction Calculator](https://qilingtools.com/en/math/fraction): Free online fraction calculator: add, subtract, multiply and divide fractions with automatic reduction, plus fraction ↔ decimal with repeating digits.
- [Percentage Calculator](https://qilingtools.com/en/math/percentage): Free online percentage calculator: X% of Y, X as a percent of Y, increase and decrease, a value after a percentage change and the original behind it.
- [Prime Factorization](https://qilingtools.com/en/math/prime): Free online prime factorization: factor an integer with exponents, list every divisor and their sum, test primality with neighbouring primes, or list a range.
- [GCD and LCM](https://qilingtools.com/en/math/gcd-lcm): Free online GCD and LCM calculator: works with two or more integers, says whether they are coprime, shows each prime factorization and every Euclidean step.
- [Statistics Calculator](https://qilingtools.com/en/math/statistics): Free online statistics calculator: paste a data set for the mean, median, mode, range, quartiles, variance, standard deviation, standard error and outliers.
