Code tool

Truth Table Generator

Build a truth table without executing the expression as code. Supported operators are NOT (!), AND (&&), XOR (^), OR (||), implication (->), equivalence (<->), and parentheses.

In-browser processingNo account requiredPrivacy details ↗

Safely parsed locally; the expression is never executed as code. Maximum 256 rows.

Enter an expression with up to 8 variables.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter an expression using variable names, constants 0 or 1, and supported operators.
  2. Generate all input combinations.
  3. Read the final value for each row.

Safe expression grammar

The expression is tokenized and parsed as Boolean syntax; it is never run as JavaScript. Keywords NOT, AND, XOR, and OR are accepted without regard to letter case.

Bounded output

At most eight distinct variables and 256 output rows are allowed. Variable names must start with a letter or underscore and may then contain digits.

GOOD TO KNOW

Common questions

Which values count as true?

Use the constant 1 for true and 0 for false. Generated rows display both input and result values as 1 or 0.

What is the operator order?

From strongest to weakest: NOT, AND, XOR, OR, implication, then equivalence. Parentheses override that order.