1. Parse the formula
The converter applies the displayed precedence rules and evaluates the resulting syntax tree for all 2n assignments of its n variables.
Use up to 8 variables and 500 characters. Names such as P, rain, and road_wet are accepted.
Private by design: your proposition is parsed and converted on this device. It is not uploaded, stored, or placed in the page URL.
Your canonical CNF, DNF, and verification table will appear here.
Press Convert to CNF and DNF or use Ctrl/⌘ + Enter.
| Operation | Accepted input | Precedence |
|---|---|---|
| NOT | !P, ~P, ¬P, P', not P | 1 (highest) |
| AND | P & Q, P * Q, P ∧ Q, P and Q | 2 |
| XOR | P ^ Q, P ⊕ Q, P xor Q | 3 |
| OR | P | Q, P + Q, P ∨ Q, P or Q | 4 |
| Implication | P -> Q, P => Q, P → Q, P implies Q | 5 |
| Biconditional | P <-> Q, P <=> Q, P ↔ Q, P iff Q | 6 (lowest) |
Constants 0, 1, false, and true are accepted. Separate adjacent variables with a space or operator: P Q means P ∧ Q, while PQ is one variable name. Parentheses override precedence; implication groups from right to left.
The converter applies the displayed precedence rules and evaluates the resulting syntax tree for all 2n assignments of its n variables.
Each true row becomes a minterm. A true variable stays positive; a false variable is negated. The minterms are joined with OR.
Each false row becomes a maxterm. A false variable stays positive; a true variable is negated. The maxterms are joined with AND.
Every minterm is true on exactly its source row, and every maxterm is false on exactly its source row. Their combined outputs therefore match the original truth table.
Canonical, not minimized: every nonconstant term or clause contains every variable. This principal form is deterministic and useful for checking coursework, deriving circuits, and moving between truth tables and formulas. For shorter two-level forms, use the Boolean Algebra Simplifier or Karnaugh Map Simplifier.
Limits and assumptions: this tool uses classical two-valued propositional logic, preserves variable order by first appearance, and supports up to 8 variables, 500 characters, and 220 tokens. Minterm indices treat the first listed variable as the most significant bit. A tautology has canonical CNF 1; a contradiction has canonical DNF 0.
Truth-table equivalence follows OpenStax’s treatment of equivalent statements. The construction also uses the standard definitions of literals, minterms, maxterms, CNF, and DNF.
Editorial review: operator truth functions, canonical-form polarity, row indexing, constants, and representative equivalences checked by the Starlight Tools editorial team. Last reviewed: .
For P → Q, the output is false only when P = 1 and Q = 0. That false row produces the maxterm (¬P ∨ Q), so the canonical CNF is simply ¬P ∨ Q.
The true rows are 00, 01, and 11. They produce the minterms (¬P ∧ ¬Q), (¬P ∧ Q), and (P ∧ Q). Their OR is the canonical DNF.
Canonical DNF is longer here because it explicitly names every true assignment. Both forms are equivalent to the input even though only the canonical CNF happens to be short.
Conjunctive normal form is an AND of one or more clauses, where each clause is an OR of literals. Disjunctive normal form is an OR of one or more terms, where each term is an AND of literals. A literal is a variable or its negation.
Take every false row. For each one, create an OR clause that is false on that row: use the positive literal when the row value is 0 and the negated literal when it is 1. AND all those maxterms together.
Take every true row. For each one, create an AND term that is true on that row: use the positive literal when the row value is 1 and the negated literal when it is 0. OR all those minterms together.
No. These are canonical or principal forms, so every term or clause includes every variable. They are systematic and directly checkable against a truth table, but Boolean minimization can often remove literals and combine terms.
Σm lists the decimal indices of the true rows used as DNF minterms. ΠM lists the false-row indices used as CNF maxterms. The displayed variable order determines the binary-to-decimal index.
A tautology has no false rows, so its canonical CNF is the empty conjunction, displayed as 1. A contradiction has no true rows, so its canonical DNF is the empty disjunction, displayed as 0. The other principal form still lists all assignments when variables occur.
Yes. Names such as rain, road_wet, and alarm2 work. Reserved words including not, and, xor, or, implies, iff, true, and false act as operators or constants.
No. Parsing, truth-table evaluation, conversion, copying, and text-file creation happen locally in your browser. The tool does not transmit or save the entered formula.