Loading the page...
Preparing tools and content for you. This usually takes a second.
Preparing tools and content for you. This usually takes a second.
Fetching calculator categories and tools for this section.
Free truth table generator for propositional logic. Type a formula with variables P–Z and standard connectives; see every assignment and the final column T/F for homework, exams, and digital logic intro courses.
Last updated: April 13, 2026
Need a custom logic tool for your LMS? Get a Quote
Example: NOT P OR Q, P XOR Q, (P -> Q) <-> (NOT Q -> NOT P)
| P | Q | Result |
|---|---|---|
| F | F | F |
| F | T | F |
| T | F | F |
| T | T | T |
4 rows (22 assignments).
Operator precedence
Typical use
Tautology · Contradiction · Equivalence
Compare two formulas by generating tables side by side manually or by reusing the same assignments.
Examples
(P|Q)&!R
Mix NOT, AND, and OR symbols for quick entry from programming habits.
Written as
-> , <->
Matches common discrete math and logic textbook notation.
True when
Inputs differ
Use XOR or ^ for parity-style logic exercises.
Tip
( ) for clarity
Nested parentheses are fully supported in the parser.
Pair with
Bit shift · Permutations
Truth tables connect to gates, canonical forms, and later to Boolean minimization.
P AND Q
Your input is tokenized into variables, operators, and parentheses, then parsed into an abstract syntax tree using standard precedence rules. For each of the 2ⁿ truth assignments to the n listed variables, the tree is evaluated bottom-up to produce the result column T/F—exactly as you would do by hand in a discrete mathematics course.
P -> Q ≡ (NOT P) OR QThis classical definition matches most logic textbooks and digital design primers.
Each row is one row of a standard truth table
Propositional logic uses compositional semantics: the truth value of a compound formula is determined only by the truth values of its subformulas. Truth tables make this compositional structure explicit for finite variable sets.
NOT (P AND Q)
Result is false only when both P and Q are true—useful for gate-level intuition.
P OR NOT P is a tautology (always T); P AND NOT P is a contradiction (always F).
Share it with your study group or class
Suggested hashtags: #Logic #DiscreteMath #ComputerScience #Mathematics #Calculator