What Is a Truth Table?
A truth table is a mathematical table used to determine whether a boolean expression is true or false for all possible combinations of its input variables.
For n variables, a truth table has 2n rows. A 2-variable expression has 4 rows, a 3-variable expression has 8 rows, and an 8-variable expression has 256 rows. This tool generates the full table for any expression with up to 8 variables.
Boolean Operators Reference
- AND (∧) — true only when both inputs are true
- OR (∨) — true when at least one input is true
- NOT (¬) — inverts the value (true → false)
- XOR (⊕) — true when inputs are different
- NAND — NOT AND (opposite of AND)
- NOR — NOT OR (opposite of OR)
- → — implication (if A then B)
- ↔ — biconditional (A if and only if B)
What Is a Karnaugh Map?
A Karnaugh map (K-Map) is a visual method for simplifying boolean expressions. It arranges truth table rows in a grid where adjacent cells differ by only one variable — allowing you to identify and eliminate redundant terms visually. K-Maps are used in digital circuit design to minimize logic gates. This tool generates the K-Map automatically from your expression.
What Are Minterms and Maxterms?
A minterm is a product (AND) term where the expression equals 1. A maxterm is a sum (OR) term where the expression equals 0.
SOP (Sum of Products) is the sum of all minterms. POS (Product of Sums) is the product of all maxterms. Both are canonical forms that represent any boolean function completely and unambiguously.
Frequently Asked Questions
- How do I generate a truth table online?
- Type or paste your boolean expression using the operator buttons — AND (∧), OR (∨), NOT (¬), XOR (⊕), NAND, NOR — then click Generate. The tool produces the complete truth table for all variable combinations, plus Karnaugh map, minterms, maxterms, and SOP/POS forms.
- What is the difference between SOP and POS forms?
- SOP (Sum of Products) expresses a boolean function as an OR of AND terms — one AND term for each row where the output is 1 (minterms). POS (Product of Sums) expresses it as an AND of OR terms — one OR term for each row where the output is 0 (maxterms). Both are complete canonical representations of the same function.
- How do I use a Karnaugh map to simplify a boolean expression?
- The K-Map groups adjacent cells where the output is 1 into rectangles of size 1, 2, 4, or 8. Each group eliminates one variable. The simplified expression is the OR of all group terms. This tool generates the K-Map automatically from your expression.
- What is De Morgan's law?
- De Morgan's laws state that NOT(A AND B) equals (NOT A) OR (NOT B), and NOT(A OR B) equals (NOT A) AND (NOT B). They allow conversion between AND and OR forms and are fundamental to digital circuit design and boolean simplification. Try the "De Morgan" example in the tool to see them in action.
- How many variables can this truth table generator handle?
- Up to 8 variables, producing truth tables with up to 256 rows. Most classroom problems use 2–4 variables (4–16 rows). The tool handles everything from simple 2-variable expressions to complex 8-variable digital logic circuits.
Related Tools
Other developer and CS tools that pair well with boolean logic and truth tables: