Truth Table Generator

Type a logic expression and get its truth table, minterms, maxterms, SOP and POS forms. Compare it with a second expression.

How it works

Type any logic expression. The tool lists every combination of the variables (2 to the power of the number of variables rows), works out the result for each, and then reads off the minterms, the maxterms and the canonical forms.

A minterm is a row where the result is 1. The canonical sum of products (SOP) ORs one AND-term for each minterm. The canonical product of sums (POS) ANDs one OR-term for each row where the result is 0. Both describe the same function.

To check whether two expressions are the same, put the second one in the compare box. The tool tests every row and shows the first row where they differ.

The formula

rows = 2^n
SOP = sum of the minterms (rows with result 1)
POS = product of the maxterms (rows with result 0)
A tautology has 2^n minterms, a contradiction has none

Worked example

A and (B or not C) has 3 variables, so 8 rows. It is 1 for A=1,B=0,C=0 (row 4), A=1,B=1,C=0 (row 6) and A=1,B=1,C=1 (row 7). So the minterms are 4, 6, 7 and the SOP is AB'C' + ABC' + ABC. Try comparing A -> B with not A or B. They agree on all 4 rows, so they are equivalent.

Good to know

Common questions

What is the difference between SOP and POS?
SOP lists the rows where the answer is 1 and ORs them. POS lists the rows where the answer is 0 and ANDs the opposite. They always give the same function, and each can be longer or shorter than the other.
How many variables can it handle?
Up to 6, which is 64 rows. More than that makes a table nobody can read.
Is the canonical SOP the simplest form?
No. It is the longest honest form. Simplification (K-map or Quine-McCluskey) merges neighbouring minterms.
What does the order of variables mean in the minterm number?
Variables are sorted alphabetically and the first one is the most significant bit. So for A, B, C the row A=1,B=0,C=1 is minterm 5.

More in Math, Science & Engineering.