Logo

MonoCalc

/

Truth Table Generator

Math
De Morgan, modus ponens, XOR identities and more.

Read as ((A ∧ B) ∨ ¬C)

Comma-separated; any variable you leave out keeps its alphabetical place.

Pin a variable to a constant

A

B

C

Contingency

True for some assignments and false for others — satisfiable but not valid.

Variables
3
Rows
8
True rows
5
False rows
3

Satisfiable: yes — witness A=T, B=T, C=T

Truth table

#ABCA ∧ B¬CA ∧ B ∨ ¬C
7
TTTTFT
6
TTFTTT
5
TFTFFF
4
TFFFTT
3
FTTFFF
2
FTFFTT
1
FFTFFF
0
FFFFTT

Showing 8 of 8 rows. Click a row to pin it and see the step-by-step evaluation below.

Normalized expression

((A ∧ B) ∨ ¬C)

Minterms Σm(0, 2, 4, 6, 7)

Maxterms ΠM(1, 3, 5)

Canonical sum of products

(¬A ∧ ¬B ∧ ¬C) ∨ (¬A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ ¬C) ∨ (A ∧ B ∧ ¬C) ∨ (A ∧ B ∧ C)

Canonical product of sums

(A ∨ B ∨ ¬C) ∧ (A ∨ ¬B ∨ ¬C) ∧ (¬A ∨ B ∨ ¬C)

About This Tool

Truth Table Generator – Evaluate Any Logic Expression by Exhaustion

A truth table settles by brute force what a piece of logic actually does. Instead of arguing about whether (A → B) ∧ (B → C) really implies A → C, you list every combination of truth values and read the answer off the page. This truth table generator takes a propositional or Boolean expression, discovers the variables inside it, enumerates all 2ⁿ assignments, and prints the result for every row — together with the intermediate steps that got there.

Writing the expression

The parser is deliberately forgiving about notation. Discrete-maths students usually type NOT (A AND B), logicians prefer ¬(A ∧ B), and programmers reach for !(A && B). All three are the same expression here, and you can mix them in one line. Digital-logic shorthand works too: A·B + A′ parses as (A ∧ B) ∨ ¬A. Variables are any names starting with a letter, so P, Q, isAdmin and Cin are all fine.

Precedence, and why it matters

A ∨ B ∧ C is not ambiguous — AND binds tighter than OR, so it reads as A ∨ (B ∧ C). Implication is looser still and associates to the right, which is why A → B → C means A → (B → C). Because precedence surprises are the most common source of a wrong answer, the tool echoes your input back fully parenthesised and draws the parse tree, so you can confirm the grouping before trusting the table.

Reading the step columns
Each intermediate column is one node of the parse tree, printed in evaluation order. Reading a row left to right reproduces exactly the working you would show by hand in an exam.

Classification and satisfiability

Once the result column exists, the verdict is a single scan. All rows true means a tautology — the formula is logically valid, and testing (premises) → conclusion this way is how you check an argument for validity. All rows false means a contradiction, which is another way of saying the expression is unsatisfiable. Anything in between is a contingency, and the tool reports how many of the 2ⁿ interpretations satisfy it along with one witness assignment.

Comparing two expressions

Enter a second expression and both get their own result column over the shared variable set. Identical columns mean the two formulas are logically equivalent — that is how you verify De Morgan’s laws, the contrapositive, or the distributive law. When the columns differ, the disagreeing rows are highlighted and the first one is named as a counterexample. That is far more useful than a bare “not equivalent”: A → B and B → A differ precisely when one side is true and the other false.

From table to circuit

Digital-logic work runs the other way — the table is the specification and the expression is the deliverable. The rows where the result is true are the minterms, written Σm(1, 2); the false rows are the maxterms, written ΠM(0, 3). From those the tool derives the canonical sum-of-products and product-of-sums forms, then runs Quine–McCluskey minimisation to collapse the canonical form down to its prime implicants. A four-term expression such as (A ∧ B) ∨ (A ∧ ¬B) reduces to plain A, and the gate count before and after tells you what the saving is worth. For two to four variables a Karnaugh map shows the same groupings laid out in Gray code.

Table size grows fast
Every extra variable doubles the table: 10 variables is 1024 rows and 12 is 4096. Pin a variable to a constant, or filter to the true rows, to keep a large table readable.

Everyday uses beyond coursework

A tangled if condition with four boolean flags has sixteen possible states, and a truth table is the quickest way to find the branch that can never be reached or the pair of flags that turn out to be redundant. Pasting the condition in, minimising it, and confirming the simplified form has an identical column is a small refactor with a proof attached. The same table also doubles as a test matrix: every row is a case worth covering.

Frequently Asked Questions

Is the Truth Table Generator free?

Yes, Truth Table Generator is totally free :)

Can I use the Truth Table Generator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Truth Table Generator?

Yes, any data related to Truth Table Generator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does this truth table generator work?

Your expression is tokenized, parsed into a syntax tree using standard logical precedence, and then evaluated once for every one of the 2ⁿ possible assignments of its variables. Intermediate sub-expressions are cached, so the columns showing each step come for free. Everything runs in your browser — nothing you type is uploaded.

Which operator symbols can I type?

Word, symbolic and programming forms are all accepted and can be mixed freely: NOT/¬/!/~/A′, AND/∧/&&/&/·/*, OR/∨/||/|/+, XOR/⊕/^, NAND/↑, NOR/↓, XNOR/⊙/≡, IMPLIES/→/->/⊃ and IFF/↔/<->/<=>. Constants may be written TRUE/FALSE, 1/0 or ⊤/⊥, and both round and square brackets group sub-expressions.

How many variables can the table handle?

Up to 12 distinct variables, which is 4096 rows. Above 10 variables the tool warns you that the table is getting large and suggests filtering to true rows only or pinning a variable to a constant. A 13th variable would double the table again, so it is refused with a clear message instead of freezing the page.

What is the difference between a tautology, a contradiction and a contingency?

A tautology is true on every row, so it is logically valid — A ∨ ¬A is the classic example. A contradiction is false on every row and therefore unsatisfiable, like A ∧ ¬A. Anything else is a contingency: true for some assignments and false for others. The badge above the table reports which one you have, along with how many rows satisfy the expression.

How does the tool decide two expressions are equivalent?

It evaluates both over the union of their variables and compares the result columns cell by cell. If every row matches they are logically equivalent; if not, the first disagreeing row is reported as a counterexample and every differing row is highlighted in the table, so you can see exactly where the two formulas part company.

Is the simplified expression guaranteed to be minimal?

The Quine–McCluskey pass finds all prime implicants and then covers the chart with the essential implicants plus a greedy selection for whatever remains. That is exact whenever the essential implicants alone cover the function, and near-minimal in the cyclic cases where a choice has to be made. The result is always checked against the original truth table before it is shown, and minimisation is capped at 8 variables because the algorithm grows exponentially.