World’s largest virtual agentic engineering & quality conference

WHENAUG 19-21
WHEREVirtual · Global
Register Now

Free Truth Table Generator Online - TestMu AI (Formerly LambdaTest)

Turn any boolean expression into a full truth table with every variable combination and its tautology verdict, and a downloadable test case view.

Categories

...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free
...
TestMu Conf 2026

World's largest virtual agentic engineering & quality conference

...

AUG 19-21, 2026

REGISTER NOW
Boolean expression
Values
View

What is a truth table generator?

A truth table generator is a tool that takes a boolean expression, works out every possible combination of true and false values for its variables, and prints the result of the expression for each one. An expression with n variables produces 2 to the power n rows, so three variables always give exactly eight rows.

The table is the underlying artifact behind decision table testing, one of the test design techniques specified in ISO/IEC/IEEE 29119-4, the software testing standard published on October 28, 2021. If you are working at the bit level rather than the condition level, the Bitwise Calculator and XOR Calculator handle single operations on numbers instead.

How does this truth table generator work?

The generator runs four steps in order, entirely in JavaScript in your browser:

  • Tokenize: the expression is split into variables, constants, parentheses, and operators, accepting word forms such as AND alongside symbol forms such as &&.
  • Parse: the tokens are built into an expression tree using the precedence table below, so parentheses and precedence decide the shape rather than left-to-right reading order.
  • Enumerate: variables are sorted alphabetically and every one of the 2 to the power n combinations is generated, running from all true at the top of the table to all false at the bottom.
  • Evaluate: each row is evaluated once for the whole expression, then the true rows are counted to label the expression a tautology, a contradiction, or a contingency.

All processing happens in your browser. No data is uploaded. The expression you type is never sent to a server, and the page writes nothing to local storage.

How do you use this truth table generator online?

  • Enter your expression in the Boolean expression box, tap the operator keys beneath it, or press Add Sample to load (A ∧ B) ∨ ¬C.
  • Choose the Values format to print each cell as T and F or as 1 and 0.
  • Choose the View: Truth table shows one row per variable combination, Test cases shows one identified case per row with its expected result.
  • Leave Auto update on to rebuild the table as you type, or switch it off and press Generate Table when you want to control the refresh.
  • Click Copy or Download CSV to take the active view away as tab separated text or a CSV file.

Which logic operators and notations does this truth table generator support?

Nine operators are supported, each with several accepted notations so you can paste an expression from code, from a textbook, or from a design document without rewriting it. Operator keywords are case insensitive.

OperatorAccepted notationsTrue when
NOTNOT, !, ~, ¬The operand is false
ANDAND, &&, &, ∧Both operands are true
OROR, ||, |, ∨At least one operand is true
XORXOR, ^, ⊕The operands differ
NANDNAND, ↑At least one operand is false
NORNOR, ↓Both operands are false
XNORXNORThe operands match
IMPLIESIMPLIES, ->, =>, →, ⊃The left side is false or the right side is true
IFFIFF, <->, <=>, ↔, ≡Both sides share the same value

Constants are written as TRUE and FALSE, or as 1 and 0. The single letters T and F are read as ordinary variables, which keeps classroom expressions such as T AND F working as a two variable table. To move between number bases while building an expression, use the Decimal to Binary converter.

What operator precedence does this truth table generator follow?

Precedence decides how an unparenthesized expression is grouped. The order below follows the relative ranking that MDN operator precedence gives the three operators JavaScript shares with boolean logic: logical NOT at precedence 14, logical AND at 4, and logical OR at 3.

TierOperatorsAssociativity
1 (binds tightest)NOTRight to left
2AND, NANDLeft to right
3XOR, XNORLeft to right
4OR, NORLeft to right
5IMPLIESRight to left
6 (binds loosest)IFFLeft to right

So A OR B AND C is read as A OR (B AND C), and A -> B -> C is read as A -> (B -> C). The header of the result column always prints the expression as the parser grouped it, so you can confirm the reading before trusting the table.

How do truth tables support decision table test design?

A boolean condition in production code is a specification for a set of test cases. Each row of its truth table is one combination of conditions and one expected outcome, which is exactly the shape decision table testing asks for in ISO/IEC/IEEE 29119-4.

  • Enumerate the cases you owe: a guard with 3 conditions has 8 combinations, so the Test cases view names all 8 rather than the 2 or 3 a reviewer usually remembers.
  • Spot dead logic before writing tests: a Contradiction verdict means the branch can never run, and a Tautology verdict means the guard never blocks anything.
  • Check a refactor preserved behavior: generate a table for the old condition and the new one, then compare the result columns row by row.
  • Load the cases into your test suite: export the Test cases view as CSV and import it, then run the resulting suite across browsers and devices with Test Manager from TestMu AI, or let KaneAI author the tests from the case descriptions.

TestMu AI runs those suites on a cloud of 10,000+ real devices and 3000+ browsers, so a decision table derived here can be executed against every environment the condition has to hold on. For bit level checks inside the same workflow, see the Binary Calculator and Bit Shift Calculator.

Frequently Asked Questions

How many rows does a truth table have?

A truth table has 2 raised to the power n rows, where n is the number of distinct variables in the expression. Two variables produce 4 rows, three variables produce 8 rows, and eight variables produce 256 rows. Each row is one unique combination of true and false values across every variable.

How many variables can this truth table generator handle?

This truth table generator accepts up to 8 distinct variables, which produces a 256 row table. Expressions using 9 or more variables are rejected with a message naming the variable count, because the row count doubles with every added variable and a 9 variable table would need 512 rows.

Can I use lowercase letters for variable names?

Yes. Variable names are case sensitive, so a and A count as two separate variables. Names may be longer than one character, which lets you write readable conditions such as isLoggedIn AND hasPayment. Operator keywords like AND and NOT are case insensitive and are never treated as variables.

Can I use T and F as variable names?

Yes. This truth table generator treats T and F as ordinary variables, not as constants, because single letter names in that range are common in logic exercises. To write a fixed constant instead, use the keywords TRUE and FALSE or the digits 1 and 0, which are never parsed as variable names.

Can I use parentheses and nested expressions?

Yes. Parentheses may be nested to any depth and always override operator precedence. An unmatched parenthesis produces the message Missing a closing parenthesis or Missing an opening parenthesis rather than a wrong table, so a typo in a long condition is reported instead of silently changing the result.

What happens if I enter an invalid expression?

The generator replaces the table with a plain language message that names the problem. Entering A AND returns The expression ends unexpectedly. Add the missing operand, and entering A B returns a message asking for an operator between the two operands. No stack trace or partial table is shown.

What is the difference between a tautology, a contradiction, and a contingency?

A tautology is true in every row of its truth table, such as A OR NOT A. A contradiction is false in every row, such as A AND NOT A. A contingency is true in some rows and false in others. This generator labels each expression with one of the three verdicts above the table.

How do you read a truth table?

Read a truth table one row at a time. The leftmost columns hold one combination of variable values, and the final column gives the value of the whole expression under that combination. Rows here run from all true at the top down to all false at the bottom, unless you reverse the variable order.

Why does A implies B evaluate to true when A is false?

Material implication is defined as false in exactly one case, when the left side is true and the right side is false. Every other combination is true, including both rows where A is false. This is why the implication column shows true, false, true, true reading from the all true row downward.

What are minterms and maxterms?

A minterm is an AND term that is true in exactly one row of a truth table, and a maxterm is an OR term that is false in exactly one row. Collecting the minterms for every true row yields a sum of products expression, while collecting maxterms yields a product of sums expression.

Can I export the truth table as CSV?

Yes. The Download CSV button exports whichever view is active. The Table view exports the variable columns and the result column. The Test cases view exports one row per test case with an identifier and an expected result, ready to import into a test management tool.

Does this truth table generator send my expression to a server?

No. Parsing, evaluation, CSV generation and clipboard copying all run in JavaScript inside your browser. The expression you type is never uploaded, logged or stored, and the page writes nothing to local storage, so closing the tab discards everything you entered.

What is the difference between XOR and OR?

OR is true whenever at least one operand is true, including the row where both are true. XOR is true only when the two operands differ, so it is false when both are true and false when both are false. The two operators differ in exactly one row of a two variable table.

Did you find this page helpful?

More Tools

Related Tools
AI Agent Tools
Code Formatters & Minifiers

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests