Free Truth Table Calculator
Operators: AND, OR, NOT, XOR, NAND, NOR, XNOR · Variables: A-Z · Parentheses: ( )
Enter a logical expression to generate the truth table
Truth Table Generator Online — A Complete Boolean Logic Calculator
Whether you're a student of digital logic or an experienced circuit designer, this free truth table generator online provides a straightforward way to evaluate Boolean expressions. It serves as both a Boolean expression calculator and a logic gate truth table reference, supporting operators such as AND, OR, NOT, XOR, NAND, NOR, and XNOR. Acting as a comprehensive truth table solver, it helps you verify tautologies, design combinational logic, and check the correctness of logical statements.
What Is a Truth Table?
A truth table is a tabular representation of a Boolean function. It lists every possible combination of truth values (True or False) for the input variables and shows the corresponding output for each combination. This tool is essential for analyzing logical expressions, identifying tautologies (statements that are always true), and designing digital circuits.
The size of a truth table depends on the number of distinct variables. For an expression with variables, the table contains rows. For instance, a three‑variable expression gives 8 rows, while six variables yield 64 rows. This truth table solver can generate full tables for up to six variables (64 rows) and evaluate single rows for expressions with up to ten variables.
How to Construct a Truth Table Step by Step
Building a truth table manually follows a simple procedure:
- Identify all distinct Boolean variables in the expression.
- Create one column for each variable and an extra column for the result.
- Fill the variable columns with every combination of T (true) and F (false). For variables, think of binary counting from 0 to .
- Evaluate the expression for each row and record the truth value.
Example: The XOR function
The exclusive OR (XOR) operation, written , has the following truth table:
| A | B | A XOR B |
|---|---|---|
| T | T | F |
| T | F | T |
| F | T | T |
| F | F | F |
XOR is true only when the two inputs differ.
Using the Truth Table Generator
The tool provides three flexible modes tailored to different tasks:
- Full truth table mode: Enter a logical expression (e.g.,
(A AND B) OR (NOT C)) and the calculator generates the complete table. It handles up to six variables (64 rows). For larger expressions, break them into smaller sub‑expressions. - Single‑row mode: Specify the number of variables (up to 10), assign each variable a truth value (T or F), and the solver computes the expression’s outcome for that particular combination. This is useful for quick spot checks.
- Logic gate truth table mode: Select any standard gate from the list (NOT, AND, OR, NAND, XOR, NOR, XNOR) and the corresponding truth table is displayed instantly. This mode is ideal for reference when learning or designing circuits.
To input expressions, use logical connectors such as AND (or &, ), OR (|, ), NOT (~, ), XOR (), and others. The interface also offers a panel of clickable symbols for convenience.
Standard Logic Gate Truth Tables
Logic gates are the fundamental building blocks of digital systems. The tables below summarize the behavior of the seven basic gates.
NOT Gate (Inverter)
| A | NOT A |
|---|---|
| T | F |
| F | T |
The NOT gate inverts its input.
AND Gate
| A | B | A AND B |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
AND outputs true only when both inputs are true.
OR Gate
| A | B | A OR B |
|---|---|---|
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
OR outputs true if at least one input is true.
NAND Gate
| A | B | A NAND B |
|---|---|---|
| T | T | F |
| T | F | T |
| F | T | T |
| F | F | T |
NAND is the complement of AND; it is false only when both inputs are true. NAND is also a universal gate, meaning any other gate can be built from a combination of NAND gates.
XOR Gate (Exclusive OR)
| A | B | A XOR B |
|---|---|---|
| T | T | F |
| T | F | T |
| F | T | T |
| F | F | F |
XOR outputs true when exactly one input is true (i.e., the inputs differ).
NOR Gate
| A | B | A NOR B |
|---|---|---|
| T | T | F |
| T | F | F |
| F | T | F |
| F | F | T |
NOR outputs true only when both inputs are false. Like NAND, NOR is a universal gate.
XNOR Gate (Exclusive NOR)
| A | B | A XNOR B |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | T |
XNOR outputs true when the two inputs are identical (both true or both false). It is the complement of XOR.
With this truth table generator, you can quickly produce any of these tables by selecting the appropriate gate in Logic Gate mode. For more complex circuits, combine multiple gates using a Boolean expression and generate the full truth table.
Why Use This Boolean Expression Calculator?
This tool saves time and reduces errors when verifying logic designs, teaching Boolean algebra, or preparing for exams. Its ability to generate truth tables for up to six variables and handle large expressions in single‑row mode makes it a versatile companion for both beginners and experts. The integrated logic gate truth table reference further streamlines the learning and design process.
FAQ
1. What is a tautology in logic?
A tautology is a logical statement that is always true regardless of the truth values of its components. Using a truth table, every row would evaluate to true.
2. How many variables can the truth table generator handle for a full table?
The full truth table mode supports up to six variables, producing a maximum of 64 rows. For expressions with more variables, you can use the single‑row mode (up to 10 variables) or break the expression into smaller parts.
3. How do I generate a truth table for a specific logic gate?
Select the third mode (Logic Gate Truth Table mode) and choose the desired gate from the list (e.g., XOR, NAND). The calculator will instantly display the complete truth table for that gate.
4. What is the difference between NAND and NOR?
NAND outputs false only when both inputs are true; NOR outputs true only when both inputs are false. Both are universal gates, meaning they can be used to construct any other logic gate.
5. How should I input a Boolean expression into the calculator?
You can use common symbols such as AND, OR, NOT, and the interface provides clickable connectors. For example, enter (A AND B) OR (NOT C) for a full truth table. Single‑row mode requires you to specify each variable's truth value using T or F.
How to Use
- Select a mode: Full Truth Table or Logic Gates.
- In Full Table mode, enter a logical expression using variables (A, B, C...) and operators: AND, OR, NOT, XOR, NAND, NOR, XNOR. Use parentheses to group sub-expressions.
- Click Generate Truth Table to see the complete truth table with all possible variable combinations and the result for each row.