Skip to content
KmapGen

Truth Table Generator

Type any Boolean expression and get its full truth table with every intermediate column, the minterm and maxterm lists, the canonical and minimal SOP/POS forms, and a one-click export to CSV, Markdown or LaTeX.

Write AND as AB, &, *, · or and; OR as +, | or or; NOT as A', !A, ~A or not A; also ^ (XOR), nand, nor, xnor, ->, <->, 0, 1. Precedence: NOT, AND, XOR, OR, →, ↔.

#ABCA'BA ⊕ CA'B + A ⊕ C
0000000
1001011
2010101
3011111
4100011
5101000
6110011
7111000

Contingency: true in 5 of 8 rows. 3 variables (A, B, C), 8 rows.

Minterms: F = Σm(1, 2, 3, 4, 6)

Maxterms: F = ΠM(0, 5, 7)

Minimal SOP: AC' + A'B + A'C (one of 2)

Minimal POS: (A + B + C)(A' + C')

Canonical SOP and POS

Canonical SOP (sum of minterms): A'B'C + A'BC' + A'BC + AB'C' + ABC'

Canonical POS (product of maxterms): (A + B + C)(A' + B + C')(A' + B' + C')

Export and next steps

Operators and how to type them

OperationSymbols acceptedTrue whenPrecedence
NOTA' !A ~A ¬A not AA is 01 (tightest)
ANDAB A&B A*B A·B A∧B A and Bboth are 12
NANDA↑B A nand Bnot both 12
XORA^B A⊕B A xor B A!=Bexactly one is 13
XNORA⊙B A xnor Bboth equal3
ORA+B A|B A∨B A or Bat least one is 14
NORA↓B A nor Bboth are 04
ImplicationA->B A=>B A→B A implies BA is 0 or B is 15 (right-associative)
BiconditionalA<->B A↔B A≡B A iff Bboth equal6 (loosest)

Precedence follows the C convention used in digital logic: NOT before AND, AND before XOR, XOR before OR. So A + BC means A + (BC) and A ^ B C means A ^ (BC). Textbooks do not agree on where XOR, NAND and NOR sit; if your course uses a different order, or when in doubt, add parentheses. They are always allowed, as are brackets [ ] and braces .

Variable names are one letter optionally followed by digits (A, x1, x_2). That is why AB'C is read as A·B'·C. Columns are sorted alphabetically; to choose the order yourself, start with a header like F(C, B, A) =.

Truth tables of the two-input operations

ABANDORXORNANDNORXNORA → B
000001111
010111001
100111000
111100011

The biconditional A ↔ B has the same table as XNOR. Symbols and chip numbers for each gate are on the logic gates page.

Worked example: A'B + (A ⊕ C)

The expression has three variables, so the table has 23 = 8 rows. The generator evaluates it in the order a person would: first the complement A', then the product A'B, then the exclusive OR A ⊕ C, and finally the OR of the two.

  • A'B is 1 only in rows 2 and 3 (A = 0, B = 1).
  • A ⊕ C is 1 when A and C differ: rows 1, 3, 4 and 6.
  • The output is 1 in rows 1, 2, 3, 4 and 6: F = Σm(1, 2, 3, 4, 6) = ΠM(0, 5, 7).

From there the minimal form is AC' + A'B + A'C (one of two equally short answers, the other being AC' + A'C + BC'). The K-map solver draws those groups if you click Open in K-map solver.

Reading the summary

  • Σm (minterm list): the row numbers where the output is 1. It is the shortest way to hand a function to a K-map or to Quine–McCluskey.
  • ΠM (maxterm list): the row numbers where the output is 0.
  • Canonical SOP / POS: one term per 1 (or one clause per 0), each containing every variable. Correct but long.
  • Minimal SOP / POS: the shortest equivalent two-level forms, computed exactly for up to 8 variables. See minterms, maxterms, SOP and POS for the theory.

Frequently asked questions

How do I make a truth table from a Boolean expression?

List every combination of the input variables (2n rows for n variables), counting up in binary. Then evaluate the expression row by row, innermost parentheses first, writing each intermediate result in its own column. The last column is the output. The generator above does exactly this and shows the intermediate columns so you can check your own work.

How many rows does a truth table have?

2n, where n is the number of distinct variables: 4 rows for 2 variables, 8 for 3, 16 for 4, 32 for 5, and 1,024 for 10. This generator accepts up to 12 variables (4,096 rows).

In what order are the rows listed?

In digital-logic order: the first row is all 0s and the rows count up in binary, with the first variable as the most significant bit. Row number = minterm number, so the row where A, B, C = 1, 0, 1 is row 5 (m5). Some logic textbooks start with the all-true row instead; the table is the same, only upside down.

How do I write implication, XOR or NAND?

Implication: A -> B, A => B, A → B or A implies B. XOR: A ^ B, A ⊕ B or A xor B. NAND and NOR: A nand B, A ↑ B, A nor B, A ↓ B. Biconditional: A <-> B, A ↔ B or A iff B.

What is a tautology in a truth table?

A tautology is an expression whose output column is all 1s, such as A + A' or ((P → Q) ∧ P) → Q (modus ponens). A contradiction is all 0s; anything else is a contingency. The generator labels the result for you.

How do I get the SOP or POS expression from a truth table?

For the canonical SOP, write one AND term per row where the output is 1 (a variable appears plain if it is 1 in that row and complemented if it is 0) and OR the terms together. For the canonical POS, write one OR clause per row where the output is 0 (plain if the variable is 0, complemented if it is 1) and AND them. To shorten either form, use the K-map solver or the simplifier.