← Math & statistics

Truth Table & Logic Evaluator (DNF/CNF, Simplified SOP)

Parse Boolean expressions, inspect the full truth table, canonical DNF/CNF, and Karnaugh or Quine–McCluskey simplifications side by side with shareable URLs, CSV export, and How it’s calculated logs.

Other languages 日本語 | English | 简体中文 | 繁體中文 | 繁體中文(香港) | Español | Español (LatAm) | Español (México) | Português (Brasil) | Português (Portugal) | Bahasa Indonesia | Tiếng Việt | 한국어 | Français | Deutsch | Italiano | Русский | हिन्दी | العربية | বাংলা | اردو | Türkçe | ไทย | Polski | Filipino | Bahasa Melayu | فارسی | Nederlands | Українська | עברית | Čeština
Display options
Parsed interpretation

Expression 1:

Operator precedence (high → low)

Operators: ! ~ (NOT), & ∧ (AND), ^ (XOR), | ∨ (OR), ->, <->, constants 0 1 T F. Variables are case-insensitive and sorted alphabetically. You can also tap the keypad buttons above.

Result summary

How to use this truth table calculator

Enter one Boolean expression to generate its table, or add a second expression to check equivalence row by row. The page keeps the workflow compact: input, result summary, step log, table, and canonical forms are all visible in one place.

How it works

The tool tokenises your expression, builds an internal syntax tree, sorts variables alphabetically, and enumerates rows from 0 upward with the first variable as the most significant bit. Canonical DNF/CNF come directly from the rows where the result is 1 or 0, and simplification uses Karnaugh-style grouping up to 4 variables, Quine–McCluskey for 5–6 variables, then canonical fallback above that range.

When to use

Use this page for Boolean algebra homework, digital logic verification, equivalence checks such as A -> B versus ~A | B, or for explaining why two formulas diverge on specific assignments.

Common mistakes to avoid

Interpretation and worked example

A quick equivalence check is to compare A -> B with ~A | B. If the summary reports equivalence, both formulas produce the same bitstring. If mismatch rows appear, use the F₁ / F₂ / ≡ columns in the table to inspect the exact assignments where the two expressions disagree.

See also

FAQ

Which operators can I use?

Use ! or ~ for NOT, & or ∧ for AND, ^ for XOR, | or ∨ for OR, -> for implication, <-> for equivalence, and constants 0, 1, T, F.

How does the simplification choose Karnaugh vs Quine–McCluskey?

Up to four variables the tool groups minterms in the same way as a Karnaugh map. Five or six variables switch to Quine–McCluskey with Petrick selection. More than six falls back to the canonical DNF.

Are variable names case-sensitive, and how are rows ordered?

Variable names are treated case-insensitively, then normalised and sorted alphabetically. The first variable in that alphabetical list is used as the most significant bit when rows are enumerated from 0 upward.

What is the practical variable limit, and when does canonical DNF fallback happen?

Up to 10 distinct variables are supported. The simplifier uses Karnaugh-style grouping up to 4 variables, Quine–McCluskey for 5 or 6, and falls back to the canonical DNF above that range.

How should I read F₂ and the mismatch rows in equivalence mode?

F₁ is the first expression, F₂ is the second, and ≡ shows whether the row matches. If mismatch rows are listed in the summary, jump to those row numbers in the paginated table to see exactly which assignments differ.

Understanding the outputs

Result summary

The summary shows the detected variables, counts of 1 and 0 rows, the full bitstring, and a hexadecimal shorthand. In equivalence mode it also tells you whether both expressions generate the same table.

Step log

The step log records the parsed form, variable order, enumerated rows, minterms, and the simplification method that was used. It is designed to support teaching, debugging, and review rather than just giving a final answer.

Canonical forms and simplification

Canonical DNF/CNF are derived directly from the truth table. The simplified SOP is provided when the selected method can reduce the expression without exceeding the supported simplification range.

Equivalence mode

When a second expression is supplied, the table adds F₂ and ≡ columns. Use these columns together with the mismatch row list in the summary to identify exactly where two formulas diverge.

Variable limits

The page supports up to 10 distinct variables. Above the small-variable range, the tool keeps the truth table exact but falls back from advanced simplification to canonical output when necessary.

Related calculators