Enter a proposition to generate its equivalent canonical conjunctive normal form (CNF) and disjunctive normal form (DNF), with minterm and maxterm indices and a complete verification table. Everything runs privately in your browser.
Enter a proposition
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.
Canonical normal forms
The example proposition is ready to convert.
Your canonical CNF, DNF, and verification table will appear here. Press Convert to CNF and DNF or use Ctrl/⌘ + Enter.
Accepted propositional logic syntax
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. For example, P ∨ Q ∧ R means P ∨ (Q ∧ R), and P → Q → R means P → (Q → R). Use explicit parentheses when you intend different grouping.
How canonical CNF and DNF conversion works
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.
2. Build DNF from true rows
Each true row becomes a minterm. A true variable stays positive; a false variable is negated. The minterms are joined with OR.
3. Build CNF from false rows
Each false row becomes a maxterm. A false variable stays positive; a true variable is negated. The maxterms are joined with AND.
4. Verify equivalence
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. A separate source review is needed to establish which equivalence claims this reference supports and whether canonical-form construction requires additional evidence. Verify bibliographic details before completing source metadata. This mathematical reference is not evidence for the converter’s parser behavior, privacy, or runtime limits.
Review documentation: supporting records are needed to substantiate the previously stated editorial-team checks of operator truth functions, canonical-form polarity, row indexing, constants, and representative equivalences. Record an editorial review date only when supported by .
Worked CNF and DNF example
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. With variables ordered as P, Q and P as the most significant bit, the complete truth table is:
Index | P | Q | P → Q
0 | 0 | 0 | 1
1 | 0 | 1 | 1
2 | 1 | 0 | 0
3 | 1 | 1 | 1
The true rows are 00, 01, and 11. They produce the minterms (¬P ∧ ¬Q), (¬P ∧ Q), and (P ∧ Q). Their OR gives the complete canonical DNF: (¬P ∧ ¬Q) ∨ (¬P ∧ Q) ∨ (P ∧ Q). With variable order P, Q, the index notation is Σm(0,1,3) for DNF and ΠM(2) for CNF.
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.
CNF and DNF converter FAQ
What are CNF and DNF?
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.
How is canonical CNF made from a truth table?
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.
How is canonical DNF made from a truth table?
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.
Are these the shortest possible normal forms?
No. These are canonical or principal forms, so every nonconstant 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.
What do Σm and ΠM mean?
Σm lists the decimal indices of the true rows used as DNF minterms. ΠM lists the decimal indices of the false rows used as CNF maxterms. Both Σm and ΠM use the displayed variable order, with the first listed variable as the most significant bit. Changing variable order can change the decimal indices without changing the underlying logical function, so always read index notation together with its variable order.
What happens for a tautology or contradiction?
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. For example, P ∨ ¬P has canonical CNF 1 and canonical DNF ¬P ∨ P. Conversely, P ∧ ¬P has canonical CNF P ∧ ¬P and canonical DNF 0.
Can I use named variables?
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.
Does the converter store my formula?
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.