Boolean Expression Calculator
Evaluate AND, OR, NOT, XOR, NAND, and NOR expressions on boolean inputs A and B. Select the operator, enter true or false, and read the result instantly.
Result
TRUE
A AND B = TRUE when A = TRUE, B = TRUE
Quick Answer
A boolean expression calculator evaluates standard logic operators on two boolean inputs A and B (or one input for NOT). AND returns true only when both A and B are true. OR returns true when at least one is true. XOR returns true when exactly one is true. NOT returns the opposite of A. NAND and NOR are the complements of AND and OR. For A = true, B = false: AND = false, OR = true, XOR = true, NAND = true, NOR = false, NOT A = false.
Boolean Operations: What the Six Operators Compute
A boolean expression calculator applies one of six standard logic operators to its inputs and returns true or false. The inputs A and B take only two values: true (1) or false (0). NOT uses only input A. The other five operators take both A and B. All results follow the truth table definitions from Boolean algebra, which is the mathematical foundation of digital logic circuits and computer science.
The Six Boolean Operator Definitions: All Six Explained
AND: A AND B = true only if both are true OR: A OR B = true if at least one is true NOT: NOT A = opposite of A XOR: A XOR B = true if exactly one is true NAND: NOT(A AND B) NOR: NOT(A OR B)
- AND: A AND B = true only if both A and B are true
- OR: A OR B = true if at least one of A or B is true
- NOT: NOT A = true if A is false; false if A is true
- XOR: A XOR B = true if exactly one of A or B is true
- NAND: A NAND B = NOT(A AND B)
- NOR: A NOR B = NOT(A OR B)
How To Evaluate a Boolean Expression With This Calculator
Inputs
- Operator: the logic gate or operation to evaluate (select from dropdown)
- A: the first boolean input (true or false)
- B: the second boolean input (true or false; hidden when NOT is selected)
Steps
- Select the operator from the list (AND, OR, NOT, XOR, NAND, NOR).
- Set A to true or false.
- If the operator requires two inputs (all except NOT), set B to true or false.
- Read the result.
Boolean Logic Worked Scenario: Building an Access Rule
Testing access logic requiring valid badge AND clear background check versus OR logic.
- AND mode: Badge=true, Background=true → AND = true (Granted).
- AND mode: Badge=true, Background=false → AND = false (Denied).
- OR mode: Badge=true, Background=false → OR = true (Granted).
AND requires both conditions; OR requires only one. Changing the operator changes the behaviour of the entire access system.
When Boolean Logic Calculators Are Worth Using
Use this calculator when tracing the output of a logic gate in a circuit for a specific set of input values, when checking a conditional expression in programming (A AND B, A OR B), or when studying digital electronics.
Assumptions
- Inputs are boolean: exactly true (1) or false (0).
- The calculator evaluates one operator at a time.
- NOT uses only A; B is ignored.
Limitations
- Does not evaluate compound expressions with multiple operators.
- Does not support three or more input variables.
In Practice
Boolean logic errors in code often come from confusing AND with OR in access or filter conditions. An inclusion filter (show items matching any criterion) requires OR; an exclusion filter (show items matching all criteria) requires AND. In security logic, defaulting to OR when AND is intended can create access vulnerabilities. Verify the logic of any critical conditional by evaluating all four combinations of A and B manually before deploying.
Related Calculators
Related Guides
- How To Simplify Boolean Expressions
Learn how to simplify boolean expressions with this step-by-step math guide. We cover basic rules, clear laws, and how to track true or false logic easily.
- How To Average Percentages Without Common Mistakes
Learn when to average percentages directly, when to use a weighted average, and why mixed group sizes can make a simple average misleading result.
- How To Find Backwards Percentages From Final Values
Learn the backwards percentage method for finding an original value before an increase or decrease, with formulas, checks, and worked examples.
- Calculator Evolution From Abacus to Online Tools Today
Follow calculator evolution from abacus and slide rules to mechanical calculators, handheld electronics, software, and modern online tools today.
- How To Find A Percentage On A Calculator, Step By Step
Find a percentage on a calculator using the percent button or the decimal method, with worked examples for percentage of a number, increase and decrease.
- How To Calculate Architectural Scale
Learn how to calculate architectural scale with this simple step-by-step math guide. We cover how to read plans, find ratios, and measure real paper lines.
Frequently Asked Questions: Boolean Expression Calculator
What is the difference between OR and XOR?
OR (inclusive OR) is true whenever at least one input is true, including when both are true. XOR (exclusive OR) is true only when exactly one input is true; it is false when both inputs are true. In formal logic and computing, OR always means inclusive unless explicitly stated otherwise.
What is the difference between AND and NAND?
NAND is the logical complement of AND: it produces the opposite output for every input combination. AND is false when both inputs are true. NAND is true in every case except when both inputs are true. NAND gates are the basis of most digital circuit design because any logic function can be built from NAND gates alone.
Why is NOR true only when both inputs are false?
NOR = NOT(A OR B). Since OR is false only when both A and B are false, NOT(OR) is true only in that case. For all other combinations, OR is true, so NOR is false. NOR, like NAND, is functionally complete.
Can I evaluate NOT B with this calculator?
The NOT operator in this calculator applies to A only. To evaluate NOT B, swap your inputs (enter your B value as A) and select NOT.
How are boolean operators used in programming?
In most programming languages, AND corresponds to &&, OR to ||, and NOT to !. XOR is often written as ^ (bitwise) or implemented with != on boolean values. These operators control branching logic (if statements), loop conditions, and filter predicates.
Sources
Last updated: . Reviewed for accuracy against the formula shown above.