mockstack.

Truth Table Generator

TABLE · K-MAP · MINIMAL FORMS ← Developer & Data

Type a logic expression to get its truth table, its simplest forms, and a Karnaugh map.

Expression
Examples
Truth Table
Simplest Forms
Karnaugh Map
READY RUNS LOCALLY

About the Truth Table Generator

Builds the truth table for a logic expression, with a column for each step, and works out its minterms and maxterms, its simplest sum-of-products and product-of-sums forms, and its Karnaugh map.

Every Setting

Expression
Type it with symbols (¬ ∧ ∨ ⊕ → ↔), words (not, and, or, xor, implies, iff), or code (! && || ^). The row of buttons and the Operators drawer add symbols that are hard to type. Up to 12 variables. The line under the box shows how it was read, with every group in parentheses, so you can check the order the operators apply in.
Values
Show the table in 1 and 0 or in T and F.
Row Order
False First counts up in binary from all 0s, which matches minterm numbers and digital logic courses. True First starts from all true, as most discrete math books do.
Formulas As
How the simplest forms and the step columns are written: logic symbols, Boolean algebra with primes and + (A′B + C), or code (!a && b).
Show Each Step
A column for every part of the expression, innermost first, so the table shows the working. Turn it off for just the variables and the result.
Letters Multiply
Reads AB as A AND B and A′ as NOT A, the way digital logic writes it. Every variable is then one letter, optionally followed by digits.
Simplest Forms
The minimal sum of products (DNF) and product of sums (CNF), found exactly with the Quine–McCluskey method for up to 10 variables, plus the full canonical forms built from every minterm and maxterm.
Karnaugh Map
For 2 to 4 variables, laid out in Gray code order so neighbors differ in one variable. Each colored ring is one group from the minimal sum of products; a group of 2, 4, or 8 cells drops 1, 2, or 3 variables. Point at a term to light up its cells.
Copy / Download CSV
The table as tab-separated text that pastes into a spreadsheet or document, or as a CSV file.

Common Questions

Why is p → q true when p is false?
An implication only promises something when p is true. When p is false the promise is not broken, so the statement counts as true. It is false on one row only: p true and q false.
What makes an expression a tautology?
It is true on every row, whatever the variables are. The summary says when that happens; a contradiction is false on every row.

Related: Number Base Converter, Regex Tester.