Zero Signup ToolsFree browser tools

Developer Tools

Truth Table Generator

Generate a truth table from any boolean expression. AND, OR, NOT, XOR, NAND, NOR, IMPLIES, IFF, multi-variable, with SOP and POS canonical forms.

Expressions

Use AND, OR, NOT, XOR, NAND, NOR, XNOR, ->, <->. Variables can be any letter, like A, B, or P_1.

1
2
3
4

Truth table

Each row is one assignment of true and false to the variables.

Values
Order
#ABA AND Bcol 1A OR Bcol 2NOT Acol 3A XOR Bcol 4
1FFFFTF
2FTFTTT
3TFFTFT
4TTTTFF

Variables

2

Rows

4

Expressions

4

Cells evaluated

16

A AND B

Contingency (sometimes true, sometimes false)

1true rows · 3 false rows

SOP (sum of products, minterms Σm(3)):
A·B
POS (product of sums, maxterms ΠM(0, 1, 2)):
(A + B)·(A + ¬B)·(¬A + B)

A OR B

Contingency (sometimes true, sometimes false)

3true rows · 1 false rows

SOP (sum of products, minterms Σm(1, 2, 3)):
¬A·B + A·¬B + A·B
POS (product of sums, maxterms ΠM(0)):
(A + B)

NOT A

Contingency (sometimes true, sometimes false)

2true rows · 2 false rows

SOP (sum of products, minterms Σm(0, 1)):
¬A·¬B + ¬A·B
POS (product of sums, maxterms ΠM(2, 3)):
(¬A + B)·(¬A + ¬B)

A XOR B

Contingency (sometimes true, sometimes false)

2true rows · 2 false rows

SOP (sum of products, minterms Σm(1, 2)):
¬A·B + A·¬B
POS (product of sums, maxterms ΠM(0, 3)):
(A + B)·(¬A + ¬B)

Supported operators

NOT

NOT, !, ~, ¬

AND

AND, &, &&, *, ·

NAND

NAND, ⊼

OR

OR, |, ||, +, ∨

NOR

NOR, ⊽

XOR

XOR, ^, ⊕, !=

XNOR

XNOR, ≡

IMPLIES

IMPLIES, ->, =>, →, ⇒

IFF

IFF, EQ, <->, <=>, ==, ↔, ⇔

Constants: 1, 0, TRUE, FALSE, T, F. Parentheses set explicit grouping. Precedence from highest to lowest: NOT, AND/NAND, XOR/XNOR, OR/NOR, IMPLIES, IFF. Identifiers are case-sensitive, so A and a are distinct variables.

How to use

  1. Type one or more boolean expressions in the input fields. Use AND, OR, NOT, XOR, NAND, NOR, XNOR, IMPLIES, IFF, or any of their symbol forms.
  2. Variables can be any identifier, like A, B, P_1, or Cin. Identifiers are case-sensitive.
  3. Click a preset (Basic logic, De Morgan, Implication, Three variables, Half adder, Full adder) to load a ready-made example.
  4. Switch the value format (T / F, 1 / 0, true / false) and the row order (F first or T first) to match your textbook or your homework convention.
  5. Read the truth table on the right. Each expression column is tagged as a tautology, contradiction, or contingency.
  6. Turn on Show canonical form to see the minterm and maxterm indexes and the SOP and POS expansions for each expression.
  7. Use Copy Markdown table, Copy CSV, or Copy summary to drop the result into a homework write-up, a wiki, a pull request, or a spreadsheet.

About this tool

Truth Table Generator turns any boolean expression into the table that classroom logic, digital design, and discrete math courses are built on. Type one expression or many side by side and the tool tokenizes the input, parses it with a small recursive-descent grammar (precedence NOT, AND/NAND, XOR/XNOR, OR/NOR, IMPLIES, IFF), discovers every free variable, and enumerates all 2^N rows from all-false to all-true (up to 12 variables and 4096 rows). The operator vocabulary covers the symbols people actually type in textbooks, papers, and Verilog or Python expressions: AND can be written AND, &, &&, *, or the middle dot ·; OR can be written OR, |, ||, or +; NOT can be written NOT, !, ~, or ¬; XOR can be written XOR, ^, ⊕, or !=; NAND, NOR, and XNOR are spelled out or given as ⊼, ⊽, and ≡; implication accepts ->, =>, →, ⇒ and the biconditional accepts <->, <=>, IFF, ==, ↔, ⇔. Constants 1, 0, TRUE, FALSE, T, F all work and parentheses set explicit grouping. Every row of the table shows the variables in the input order and one column per expression, with optional T/F, 1/0, or true/false formatting and ascending or descending order so the layout matches whatever convention your class or textbook uses. Each expression column carries a live tag: tautology (every row true), contradiction (every row false), or contingency (mixed), plus minterm and maxterm index lists and the canonical sum-of-products (Σm) and product-of-sums (ΠM) form built from those indexes (useful for Karnaugh-map setup and gate-level synthesis). When two expressions evaluate to the same column they are flagged as logically equivalent, which is the fastest way to verify De Morgan's laws, double negation, distribution, absorption, and other propositional identities. One-click Copy buttons produce a Markdown table ready to paste into a homework PDF or pull request, a CSV ready for a spreadsheet, and a plain-text summary with classifications and equivalences. Everything runs locally in your browser; the expressions you type stay on your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools