TSToolSphere

Truth Table Generator

engineering100% Client-Side

Generate the full truth table for a boolean expression with up to 5 variables.

Truth Table Generator

Use single-letter variables (A-Z). Operators: & or * (AND), | or + (OR), ^ (XOR), ! or ~ (NOT). Parentheses supported. Adjacent letters imply AND (e.g. AB means A AND B).

ABCResult
0001
0010
0101
0110
1001
1010
1101
1111

About Truth Table Generator

Truth Table Generator

Parses a boolean expression and generates its complete truth table — every possible combination of input values, along with the resulting output for each. Supports AND, OR, XOR, and NOT, combined with parentheses, for up to 5 variables (32 rows).

Truth tables are a foundational tool in digital logic design and discrete math coursework: they exhaustively show how a boolean function behaves, which makes them useful both for verifying an expression by hand and for deriving simplified logic circuits. Typing out a table for more than 3-4 variables by hand is tedious and error-prone, which is exactly the gap this tool fills.

Parsing uses a small recursive-descent parser, not eval(), so arbitrary code is never executed — your expression is safely interpreted as boolean logic only.

Typical use cases: checking a digital logic homework answer, verifying a boolean expression before implementing it in code or hardware, or exploring how a circuit behaves across all input combinations.

Educational Guides & Tutorials

Frequently Asked Questions

Help Us Improve Truth Table Generator

Did you find this tool helpful? Tell us how we can make it even better, or report a bug or request a new feature in under 1 minute.

Submit Feedback