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
Operators: ! NOT · & AND · | OR · ^ XOR · # NOR · @ NAND · % XNOR. Words AND/OR/NOT/XOR and parentheses also work.
| A | B | C | A & (B | !C) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
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.
- Type a boolean expression using variables A–H.
- Combine them with operators: ! for NOT, & for AND, | for OR, ^ for XOR.
- Use parentheses to group sub-expressions where needed.
- Read the generated truth table — one row per input combination.
- 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.
| Operator | Symbol | Word | Meaning |
|---|---|---|---|
| NOT | ! | NOT | Negation — true becomes false |
| AND | & | AND | True only when both sides are true |
| OR | | | OR | True when at least one side is true |
| XOR | ^ | XOR | True 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
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
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal instantly. Essential tool for programmers and developers.
Chmod Calculator
Calculate Unix file permissions with an interactive chmod calculator. Convert between octal (755) and symbolic (rwxr-xr-x) notation instantly. Free online.
Regex Tester
Test and debug regular expressions online. See live matches, capture groups, and replace output. Free, private, instant.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Includes syntax highlighting, error detection, and a collapsible tree view — free, private, in-browser.
Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to text. Fast, free, and runs entirely in your browser.
URL Encoder / Decoder
Encode and decode URLs and URL components online. Convert special characters to percent-encoding and back instantly — free, private, and fast.
Explore all Developer Tools.