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.
Truth table
Each row is one assignment of true and false to the variables.
| # | A | B | A AND Bcol 1 | A OR Bcol 2 | NOT Acol 3 | A XOR Bcol 4 |
|---|---|---|---|---|---|---|
| 1 | F | F | F | F | T | F |
| 2 | F | T | F | T | T | T |
| 3 | T | F | F | T | F | T |
| 4 | T | T | T | T | F | F |
Variables
2
Rows
4
Expressions
4
Cells evaluated
16
A AND B
Contingency (sometimes true, sometimes false)1true rows · 3 false rows
A OR B
Contingency (sometimes true, sometimes false)3true rows · 1 false rows
NOT A
Contingency (sometimes true, sometimes false)2true rows · 2 false rows
A XOR B
Contingency (sometimes true, sometimes false)2true rows · 2 false rows
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
- 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.
- Variables can be any identifier, like A, B, P_1, or Cin. Identifiers are case-sensitive.
- Click a preset (Basic logic, De Morgan, Implication, Three variables, Half adder, Full adder) to load a ready-made example.
- 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.
- Read the truth table on the right. Each expression column is tagged as a tautology, contradiction, or contingency.
- Turn on Show canonical form to see the minterm and maxterm indexes and the SOP and POS expansions for each expression.
- 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
Bitwise Calculator
Bit-by-bit AND, OR, XOR, NOT, shift, and rotate over two operands at any width.
Open tool
ConverterNumber Base Converter
Binary, octal, decimal, hex, and custom-base conversion with two's complement.
Open tool
ConverterBinary Translator
Bidirectional text and binary translation with UTF-8 byte breakdown.
Open tool
DeveloperASCII Table
Searchable ASCII reference plus a two-way text-to-code converter.
Open tool
CalculatorGCD and LCM Calculator
GCD and LCM for any set of integers, with Euclidean steps and prime factorization.
Open tool