Skip to main content
ToolsHub

Truth Table Generator

Type a boolean expression and instantly see its full truth table for every input combination — all evaluated locally in your browser.

Updated

Files never leave your browser

Operators: ! NOT · & AND · | OR · ^ XOR · # NOR · @ NAND · % XNOR. Words AND/OR/NOT/XOR and parentheses also work.

Truth table (8 rows)
ABCA & (B | !C)
0000
0010
0100
0110
1001
1010
1101
1111

How to use Truth Table Generator

The Truth Table Generator evaluates any boolean expression across every possible combination of its inputs and lays the results out in a clear table, instantly in your browser. Type an expression using variables A–H and operators such as AND, OR, NOT and XOR, and the tool computes a row for each of the 2ⁿ input combinations. It is the fastest way to verify digital-logic homework, reason about a complex if-condition, or confirm that two boolean formulas are equivalent without reaching for pencil and paper.

  1. Type a boolean expression using variables A–H.
  2. Combine them with operators: ! for NOT, & for AND, | for OR, ^ for XOR.
  3. Use parentheses to group sub-expressions where needed.
  4. Read the generated truth table — one row per input combination.
  5. Copy the table as Markdown to paste into docs or homework.

Your data never leaves your device — 100% private processing.

Operators and precedence

The generator recognises the full set of common boolean operators so you can write expressions naturally. NOT can be written as ! or the word NOT and binds most tightly. AND (& or the word AND) is next, followed by the exclusive operators XOR (^) and XNOR (%), and finally the inclusive operators OR (| or the word OR) and NOR (#). NAND is written as @. When operators of different precedence appear together the tighter one is applied first, so A | B & C is read as A | (B & C). Whenever the default order is not what you mean, wrap the part you want evaluated first in parentheses to make the intent explicit and unambiguous.

Supported boolean operators
OperatorSymbolWordMeaning
NOT!NOTNegation — true becomes false
AND&ANDTrue only when both sides are true
OR|ORTrue when at least one side is true
XOR^XORTrue when the sides differ
NAND@Negated AND
NOR#Negated OR
XNOR%True when the sides are equal

How rows are ordered

Variables are detected automatically, de-duplicated and sorted alphabetically, then used as the table columns. The rows enumerate every combination of those inputs in standard binary-counting order: the first row sets all variables to 0 (false) and the last sets them all to 1 (true), with the right-most variable toggling fastest. For n variables this produces exactly 2ⁿ rows — two variables give four rows, three give eight, and so on up to the eight-variable, 256-row limit. Presenting the inputs in this canonical order makes it easy to compare two tables side by side or to spot patterns such as a column that always matches another.

Worked examples

Simple AND

Inputs: A & B

Result: Four rows; result is 1 only when A=1 and B=1.

Grouped expression

Inputs: A & (B | !C)

Result: Eight rows across variables A, B and C.

Glossary

Truth table
A table listing the output of a boolean expression for every possible combination of its input values.
Boolean expression
A formula combining true/false variables with logical operators that evaluates to true or false.
Operator precedence
The order in which operators are applied when an expression has no parentheses to force grouping.
XOR
Exclusive OR — an operator that is true exactly when its two operands differ.
Tautology
An expression that is true for every input combination, shown as an all-true result column.

Related reading

Frequently Asked Questions

Free · No spam

Get weekly tool tips & updates

New tools, power-user tips, and productivity hacks — delivered free every Friday.

No spam, ever. Unsubscribe with one click.

Why use Truth Table Generator?

  • Evaluate every input combination automatically — no manual row-by-row work
  • Supports AND, OR, NOT, XOR, NAND, NOR and XNOR plus parentheses
  • Accepts both symbols (&, |, !, ^) and words (AND, OR, NOT, XOR)
  • Handles up to 8 variables for a complete 256-row table
  • Runs entirely client-side, so nothing you type leaves the page

Common use cases

  • Check digital-logic and discrete-math homework answers
  • Simplify a tangled if-condition by seeing exactly when it is true
  • Prove two boolean expressions are equivalent by comparing tables
  • Design and verify logic-gate circuits before building them
  • Teach or learn boolean algebra with concrete, generated examples

Related Developer Tools

Explore all Developer Tools.