Boolean Logic Calculator
Evaluate Boolean expressions, test logical conditions, and generate truth tables. Supports AND, OR, NOT, XOR, NAND, NOR and XNOR.
Boolean expression evaluator
Enter an expression, choose the input values, and calculate its result.
Input values
Truth table generator
Calculate the output for every possible combination of inputs.
Boolean operators
Boolean values are either true (1) or false (0).
| Operator | Symbol alternatives | Meaning |
|---|---|---|
AND | &, &&, * | True only when both inputs are true. |
OR | |, ||, + | True when at least one input is true. |
NOT | !, ~ | Reverses a Boolean value. |
XOR | ^ | True when the inputs differ. |
NAND | Word operator | The inverse of AND. |
NOR | Word operator | The inverse of OR. |
XNOR | Word operator | True when the inputs are equal. |
Precedence: NOT, AND/NAND, XOR/XNOR, then OR/NOR. Use parentheses to make the evaluation order explicit.
How to use this calculator
- Enter an expression using variable names such as A, B, and C.
- Connect variables using the supported logical operators.
- Select 0 (False) or 1 (True) for each variable.
- Click Evaluate expression to calculate one result.
- Click Generate truth table to see all input combinations and outputs.
Example: AND truth table
The AND operator is true only when both inputs are true.
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 (False) |
| 0 | 1 | 0 (False) |
| 1 | 0 | 0 (False) |
| 1 | 1 | 1 (True) |
Frequently asked questions
What is a Boolean logic calculator?
It evaluates expressions built from true/false values, variables, and logical operators.
What is a truth table?
A truth table lists every possible combination of input values and the resulting output. Three variables produce eight combinations.
What is the difference between Boolean logic and bitwise operations?
Boolean logic evaluates true/false conditions. Bitwise operations manipulate individual bits in integer values. See the Bitwise & Logic Tools page for bitwise calculations.
Does this calculator simplify Boolean expressions?
This version evaluates expressions and generates truth tables. It does not automatically minimize expressions.
How many variables can I use?
Up to eight distinct variables are supported, giving a maximum of 256 truth-table rows.