ToollyX
no sign-up · instant · free

Truth Table Generator

Generate a full truth table for any logical expression, check whether two expressions are logically equivalent, derive DNF and CNF, or view a Karnaugh map for visual simplification.

Modes3 Modes
IncludesDNF, CNF, K-Map
Operators7 Operators
CostFree, No Signup
728 × 90 — Leaderboard Ad
Truth Table Generator
Logical Expression

Variables are letters (p, q, r…). Also accepts AND/OR/NOT/XOR words, && || ! ^ -> <->, and NAND/NOR.

Contingency3 variables, 8 rows
pqr(p ∧ q)¬r((p ∧ q) ∨ ¬r)
FFFFTT
FFTFFF
FTFFTT
FTTFFF
TFFFTT
TFTFFF
TTFTTT
TTTTFT
DNF: (¬p ∧ ¬q ∧ ¬r) ∨ (¬p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ ¬r) ∨ (p ∧ q ∧ ¬r) ∨ (p ∧ q ∧ r)
CNF: (p ∨ q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r) ∧ (¬p ∨ q ∨ ¬r)
⚙️Settings
Show Sub-Expression Steps
Add a column for every intermediate operation
Show DNF & CNF
Derive normal forms directly from the truth table
Highlight True Rows
Shade rows where the result is true
📐Operator Reference
NOT ¬
! ~ ¬ or a trailing apostrophe
AND ∧
&& & ∧ or the word AND
OR ∨
|| | ∨ or the word OR
XOR ⊕
^ ⊕ or the word XOR
IMPLIES →
-> => → or the word IMP
IFF ↔
<-> <=> ↔ or the word IFF
Precedence
¬ > ∧ > ⊕ > ∨ > → > ↔
728 × 90 — Leaderboard Ad

⚡ Quick Tips for Building Clean Truth Tables

01Parenthesize whenever precedence isn't obvious at a glance. p ∨ q ∧ r and (p ∨ q) ∧ r are different expressions — don't rely on memorized operator order for anything you'll reuse later.
02Use Equivalence Checker to actually prove an identity instead of asserting it. Typing both sides of De Morgan's law in and comparing the tables is more convincing than memorizing the rule.
03Turn on sub-expression steps the first time you build a complex expression. Seeing each intermediate column makes it obvious exactly where a mistake enters, instead of just staring at a wrong final answer.
04Use the Karnaugh map only for 2–4 variables. Beyond that, the grid becomes harder to read than the truth table it's built from — DNF and CNF stay reliable at any size.

Features

Full Truth Table Generation

Any expression, any number of variables, computed instantly as you type.

📋Sub-Expression Step Columns

See every intermediate operation, not just the final result.

Equivalence Checker

Prove two expressions match — or find the exact row where they don't.

DNF & CNF Derivation

Normal forms built directly and correctly from the truth table.

Karnaugh Map

Gray-code-ordered grid for 2-4 variables, ready for manual grouping.

🏷️Tautology / Contradiction Detection

Automatic classification — no manual scan of the table required.

What This Truth Table Generator Actually Does

A basic truth table generator lists every input combination and one output column — genuinely useful, but only the first step of what studying logic actually requires. This tool covers the three jobs that come up right after: seeing not just the final answer but every intermediate operation that built it, proving two differently-written expressions are secretly identical rather than just eyeballing them, and reading off a guaranteed-correct simplified form instead of trusting an algebraic simplification done by hand. Truth Table, Equivalence Checker and Karnaugh Map each handle one of those jobs directly, on the same underlying parser and evaluator.

Operator Precedence Is Where Most Manual Truth Tables Go Wrong

Write p ∨ q ∧ r on paper and it's genuinely ambiguous unless a precedence convention is agreed on first. This tool follows the standard order taught across most propositional logic courses — NOT binds tightest, then AND, then XOR, then OR, then IMPLIES, then IFF last — meaning p ∨ q ∧ r parses as p ∨ (q ∧ r), not (p ∨ q) ∧ r. Those two readings produce genuinely different truth tables, which is exactly the kind of silent error that creeps into a hand-built table when precedence is assumed rather than checked. Parentheses always win regardless of the default order, so wrapping a sub-expression explicitly is the safest habit whenever there's any doubt at all.

Tautology, Contradiction, or Contingency — What the Last Column Reveals

Once a full table is built, its last column tells a story beyond the individual rows. A tautology — true in every row, like p ∨ ¬p — represents a logical certainty, true regardless of what p actually is. A contradiction — false in every row, like p ∧ ¬p — represents an impossible combination that can never be satisfied. Most expressions land in between as a contingency, true for some inputs and false for others, which is the normal, useful case for describing an actual condition rather than a pure logical identity. This classification gets computed automatically the moment a valid expression is entered, rather than requiring a manual scan down every row.

728 × 90 — Leaderboard Ad

Proving Two Expressions Are Actually the Same

De Morgan's laws, the distributive law, double negation — propositional logic is full of rules claiming two differently-written expressions always produce the same result. Equivalence Checker turns that claim into a direct proof rather than something to memorize: it builds one combined truth table across every variable in either expression and compares the two result columns row by row. Every row matching confirms genuine logical equivalence, no matter how different the two expressions look on the page; even one mismatched row disproves it immediately, with that exact row highlighted as the counterexample. It's the same technique used to verify a proposed logic circuit simplification actually behaves identically to the original before it gets built.

DNF and CNF Aren't Just Notation — They're a Recipe

Disjunctive normal form is literally built from the truth table itself: take every row where the result is true, turn its variable values into one AND-term, and OR all those terms together. Conjunctive normal form mirrors that process using the false rows and OR-terms instead. Because both forms are constructed directly from the table rather than simplified algebraically by hand, they're guaranteed correct by construction — every true row genuinely is captured in the DNF, every false row genuinely excluded. The trade-off is that this canonical form isn't always the shortest possible way to write the expression; it's a reliable starting point, not necessarily the most compact one.

Reading a Karnaugh Map

A Karnaugh map rearranges the exact same truth table rows into a grid where physically neighboring cells — including wrapping from the last column back to the first — always differ in exactly one variable, a property guaranteed by ordering rows and columns in Gray code rather than plain binary counting order. That single property is what makes visual simplification possible: circling an adjacent group of 1s in a size that's a power of two (1, 2, 4, or 8 cells) reveals which variable can be dropped from that group entirely, since it's the one variable changing across the group while the rest stay fixed. This tool renders the grid correctly for 2 to 4 variables and leaves the actual grouping and simplification as the hands-on step it's meant to be.

Where People Actually Use Truth Tables

Computer science and digital logic students use them to design and verify logic gates before ever touching a breadboard — a Binary Calculator picks up once a truth table's logic needs translating into actual bit-level operations. Database and query designers use the same AND/OR/NOT reasoning to verify a complex WHERE clause behaves as intended across every edge case. Programmers reach for a truth table when a tangled if-statement needs simplifying, treating each condition as a variable to confirm a proposed shorter version is genuinely equivalent rather than just similar. Philosophy and formal logic students use them constantly to evaluate arguments for validity, since a valid argument form is, underneath the natural-language dressing, exactly a tautology.

The Honest Limits of This Tool

This generator handles propositional (Boolean) logic — variables that are simply true or false — not first-order predicate logic with quantifiers like "for all" or "there exists," which needs a fundamentally different kind of tool entirely. The Karnaugh map is intentionally capped at 4 variables, since a 5- or 6-variable map becomes harder to read visually than the underlying table it represents. And while DNF and CNF are always correct, this tool doesn't perform further algebraic minimization to find the absolute shortest possible equivalent expression — that's a distinct, harder optimization problem beyond generating and reading a table correctly. For writing up a finished logical formula cleanly for a report, the LaTeX Equation Renderer handles the typesetting side.

Frequently Asked Questions

728 × 90 — Leaderboard Ad