Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Normal Forms Converters

DNF Converter using Truth Tables

Use standard logical symbols: ∧ (AND), ∨ (OR), ¬ (NOT), → (IMPLIES), ↔ (IFF)
Type your expression or use examples instead.

Examples:

How DNF Conversion Works:

1. Create a truth table for the expression
2. Find all rows where the expression evaluates to true
3. For each 'true' row, create a conjunction (AND) of literals that makes that row true:
• If a variable is true in the row, use the variable itself
• If a variable is false in the row, use the negation of the variable
4. Join all these conjunctions with OR operations
5. The resulting expression is in DNF




Getting Started with the Converter

The tool opens with two tabs at the top: DNF Converter and CNF Converter. Click either tab to switch modes. Both share the same layout: an input field on the left for your logical expression and a step-by-step explanation panel on the right.

Type your expression directly into the input field using standard logical symbols. The tool accepts lowercase variables (p, q, r, etc.) and five connectives: \wedge (AND), \vee (OR), ¬\neg (NOT), \to (IMPLIES), and \leftrightarrow (IFF). You can also type shorthand notation like -> for implication, <-> for biconditional, and ! for negation, which the converter normalizes automatically.

If you prefer not to type symbols manually, click one of the three preset example buttons below the input field: pqp \to q, ¬(pq)\neg(p \wedge q), or p(qr)p \wedge (q \vee r). Each loads the expression into the input field so you can convert it immediately or edit it further before converting.

Converting and Reading Results

After entering your expression, click the blue "Convert to DNF" or "Convert to CNF" button depending on the active tab. The tool generates a complete truth table and displays it below the input area.

In DNF mode, rows where the expression evaluates to true are highlighted in green with bold text. An "Include in DNF" column on the right shows "Yes" for these rows. Each included row contributes one minterm to the final DNF expression.

In CNF mode, rows where the expression evaluates to false are highlighted in red with bold text. An "Include in CNF" column shows "Yes" for these rows. Each included row contributes one maxterm to the final CNF expression.

The resulting normal form expression appears below the truth table in a monospace display block. Use the Copy button inside the input field to copy your original expression to the clipboard, or select the result text directly to copy the converted output.

Input Controls and Error Handling

The input field includes two inline controls. The Copy button copies your current expression to the clipboard and briefly changes its label to "Copied!" as confirmation. The X button clears the input field along with any displayed truth table and result, giving you a clean slate.

If your expression contains a syntax error, such as missing parentheses or unrecognized characters, a red error message appears below the example buttons describing the problem. The converter accepts only single uppercase or lowercase letters as variables and the five standard logical connectives. Numbers, multi-character variable names, and unknown symbols will trigger an error.

When no variables are found in the input, the converter reports "No variables found in expression." Check that your input contains at least one alphabetic character representing a propositional variable.

Understanding the Step-by-Step Panel

The right side of each tab displays a panel explaining the conversion algorithm in numbered steps. This panel is always visible and does not change based on your input. It serves as a quick reference so you can follow along as the truth table and result update on the left.

For DNF, the panel explains that the converter finds true rows, builds a conjunction for each, and joins them with OR. For CNF, the panel explains that the converter finds false rows, builds a disjunction for each, and joins them with AND.

The panel also clarifies the literal assignment rule: in DNF, a true variable stays positive and a false variable gets negated. In CNF, the rule is inverted: a true variable gets negated and a false variable stays positive. This inversion is the key difference between how minterms and maxterms are constructed from truth table rows.

How DNF Conversion Works

Disjunctive Normal Form expresses any proposition as an OR of AND-clauses. Each AND-clause is called a minterm and contains every variable from the expression exactly once, either in positive or negated form.

The conversion follows a systematic process. First, the converter builds a truth table with 2n2^n rows for nn variables. It then identifies every row where the expression evaluates to true. For each true row, it creates a conjunction: variables assigned true appear as themselves, and variables assigned false appear negated. All conjunctions are wrapped in parentheses and joined with the OR operator.

For example, pqp \to q has three true rows. Each produces a minterm, and the final DNF is the disjunction of those three minterms. If every row is true, the result is simply "true" (a tautology). If no row is true, the result is "false" (a contradiction).

How CNF Conversion Works

Conjunctive Normal Form expresses any proposition as an AND of OR-clauses. Each OR-clause is called a maxterm and contains every variable exactly once.

The CNF algorithm mirrors DNF but targets false rows. The converter scans the truth table for rows where the expression evaluates to false. For each false row, it builds a disjunction: variables assigned true appear negated, and variables assigned false appear as themselves. All disjunctions are wrapped in parentheses and joined with the AND operator.

Each maxterm eliminates exactly one falsifying assignment. When all maxterms are combined, every false row is excluded, leaving only the true assignments. If no row is false, the result is "true." If every row is false, the result is "false." The output is always logically equivalent to the original expression.

DNF vs CNF: When to Use Each

Both forms are canonical representations, meaning every propositional formula has a unique equivalent in each form up to reordering of clauses and literals.

Disjunctive Normal Form enumerates all scenarios that make a statement true. Each minterm is one satisfying assignment. DNF is commonly used in database query optimization and in describing output conditions for digital systems. In circuit design, DNF corresponds to a sum-of-products implementation.

Conjunctive Normal Form enumerates constraints that must all hold simultaneously. CNF is the standard input format for SAT solvers and resolution-based proof systems used in hardware verification, software testing, and AI planning. In circuit design, CNF corresponds to a product-of-sums implementation.

A formula with many true rows produces a long DNF but a short CNF. A formula that is mostly false produces a compact DNF and a lengthy CNF. Choosing the shorter form reduces clause count and simplifies subsequent analysis.

Minterms and Maxterms

A minterm is a conjunction of literals where every variable appears exactly once, either positive or negated. Because each variable is fixed to a specific truth value, a minterm is true for exactly one row of the truth table and false for all others. DNF is the disjunction of all minterms corresponding to true rows.

A maxterm is a disjunction of literals with the same completeness requirement. A maxterm is false for exactly one row and true for all others. CNF is the conjunction of all maxterms corresponding to false rows.

The number of minterms in the DNF equals the number of true rows. The number of maxterms in the CNF equals the number of false rows. Together they always sum to 2n2^n, where nn is the number of variables. This duality means you can convert between the two forms by switching which rows you target and swapping the roles of AND and OR.

What Are Normal Forms in Logic?

A normal form is a standardized way of writing a logical expression so that every formula has exactly one canonical representation. Normal forms eliminate structural ambiguity and make it possible to compare two formulas by comparing their normalized versions.

In propositional logic, the two most important normal forms are DNF and CNF. Both require that the expression use only three connectives: AND (\wedge), OR (\vee), and NOT (¬\neg). Any implication, biconditional, or exclusive-or must first be rewritten using these three operators before the normal form can be constructed. The converter handles this rewriting internally during truth table evaluation.

Normal forms also appear in other areas of mathematics and computer science. Databases use normal forms to organize table structures, and linear algebra uses row echelon form for matrices. The underlying idea is always the same: reduce varied representations to a single standard shape that is easier to analyze.

Related Concepts and Tools

Propositional logic syntax defines the grammar rules for building well-formed formulas. Normal form conversion assumes a valid input expression that conforms to these rules.

Truth tables are the exhaustive evaluation method that underpins both DNF and CNF construction. The converter builds one internally for every input expression.

Logical equivalence means two expressions produce identical truth tables. A formula and its DNF or CNF are always logically equivalent by construction.

Boolean algebra provides algebraic laws such as De Morgan's laws and the distributive law that can simplify normal form expressions after conversion.

SAT solvers accept CNF as input and determine satisfiability. Converting to CNF is the standard preprocessing step before applying these tools.