Boolean Expression Evaluator – Evaluate Logic Expressions Online
Evaluate any Boolean expression for given variable values with our free online Boolean expression evaluator. Supports all logical operators including AND, OR, NOT, XOR, NAND, and NOR.
Use variables: A, B
Boolean Expression Evaluator – Logic Calculator
Boolean algebra is the mathematics of logic. Developed by George Boole in 1854, it uses variables that can only be TRUE or FALSE, combined with logical operators. This system forms the foundation of all digital circuits – every processor, memory chip, and logic gate operates on Boolean principles.
This evaluator lets you test logical expressions with custom variable values. Whether you're designing digital circuits, writing conditional statements in code, or studying discrete mathematics, you can verify your logic expressions instantly.
Logical Operators
AND
Otherwise = FALSE
Both conditions must be true. Like a series circuit – current flows only if both switches are closed.
OR
Otherwise = TRUE
At least one condition must be true. Like a parallel circuit – current flows if either switch is closed.
NOT
NOT FALSE = TRUE
Inverts the value. Also called negation or complement. Flips TRUE to FALSE and vice versa.
XOR (Exclusive OR)
Different values = TRUE
True when exactly one input is true. Used in adders, comparators, and encryption.
NAND (NOT AND)
Otherwise = TRUE
The opposite of AND. NAND gates are "functionally complete" – you can build any logic circuit using only NAND gates.
NOR (NOT OR)
Otherwise = FALSE
The opposite of OR. Like NAND, NOR gates are functionally complete – any circuit can be built from NOR alone.
Truth Tables
AND Truth Table
OR Truth Table
XOR Truth Table
Worked Examples
Example 1: Simple AND
Evaluate: A AND B, where A = TRUE, B = FALSE
Example 2: Compound Expression
Evaluate: (A AND B) OR (NOT C), where A = TRUE, B = FALSE, C = TRUE
Example 3: XOR Logic
Evaluate: A XOR B, where A = TRUE, B = FALSE
Example 4: NAND Gate
Evaluate: A NAND B, where A = TRUE, B = TRUE
Example 5: Complex Expression
Evaluate: (A OR B) AND (NOT A OR C), where A = FALSE, B = TRUE, C = FALSE
Example 6: NOR Gate
Evaluate: A NOR B, where A = FALSE, B = FALSE
Quick Fact
George Boole published "The Laws of Thought" in 1854, creating Boolean algebra. He died in 1864, long before his work became the foundation of digital computing. In 1937, Claude Shannon's master's thesis showed how Boolean algebra could optimize relay circuits – launching the digital age.
Frequently Asked Questions
What is Boolean algebra used for?
Boolean algebra is the mathematical foundation of all digital logic. It's used in circuit design, programming conditionals, database queries, search engines, and anywhere decisions depend on multiple conditions. Every if-statement in code uses Boolean logic.
What's the order of operations for Boolean expressions?
NOT has highest precedence, then AND, then OR. XOR, NAND, and NOR have varying precedence depending on context. Use parentheses to make your intended order explicit: NOT A AND B means (NOT A) AND B, not NOT (A AND B).
How do I simplify Boolean expressions?
Use Boolean algebra laws: De Morgan's laws (NOT (A AND B) = NOT A OR NOT B), distributive law (A AND (B OR C) = (A AND B) OR (A AND C)), and absorption (A OR (A AND B) = A). Karnaugh maps help visualize simplifications for complex expressions.
What's the difference between XOR and OR?
OR is TRUE if at least one input is TRUE (including both). XOR is TRUE only if exactly one input is TRUE – not both. XOR means "one or the other, but not both." OR means "one or the other, or both."
Can I use numbers instead of TRUE/FALSE?
In many programming languages, 0 is FALSE and any non-zero value is TRUE. This calculator uses explicit TRUE/FALSE for clarity. In Boolean algebra, the values are often written as 1 (TRUE) and 0 (FALSE).
What are De Morgan's Laws?
De Morgan's Laws show how to distribute NOT over AND/OR: NOT (A AND B) = NOT A OR NOT B, and NOT (A OR B) = NOT A AND NOT B. These are essential for simplifying expressions and designing circuits with only NAND or only NOR gates.
How many possible Boolean functions exist for n variables?
For n variables, there are 2^n possible input combinations, and each can map to TRUE or FALSE. So there are 2^(2^n) possible Boolean functions. For 2 variables: 2^(2^2) = 16 functions. For 3 variables: 2^(2^3) = 256 functions.
Other Free Tools
Truth Table Generator – Create Logic Truth Tables Online
Generate truth tables for any logical expression with our free online truth table generator. Supports AND, OR, NOT, XOR, NAND, NOR, and implication operators for any number of variables.
Logic Gate Simulator – Simulate AND OR NOT Gates Online
Simulate any combination of digital logic gates with our free online logic gate simulator. Set input values and see real-time output for AND, OR, NOT, NAND, NOR, and XOR gates.
Binary Addition & Subtraction Calculator – Compute in Base 2
Add and subtract binary numbers step by step with our free online binary calculator. See each bit-by-bit operation clearly – perfect for computer science and digital electronics.
Bitwise Operations Calculator – Compute AND OR XOR NOT Shifts
Perform bitwise AND, OR, XOR, NOT, left shift, and right shift operations on integers with our free online bitwise calculator. See binary representations alongside results.
Number Base Converter – Binary, Octal, Decimal, Hex Converter
Convert numbers between binary, octal, decimal, and hexadecimal bases instantly with our free online number base converter. Perfect for computer science students and programmers.
Data Storage Converter – Convert KB, MB, GB, TB Online
Convert between any digital storage unit with our free online data storage converter. Supports bytes, kilobytes, megabytes, gigabytes, terabytes, and petabytes instantly.
Free Online Scientific Calculator – Advanced Math Functions
Perform complex scientific calculations online with our free scientific calculator. Supports trigonometry, logarithms, exponents, roots, and more – ideal for students and professionals.
BODMAS / PEMDAS Calculator – Order of Operations Solver
Solve any math expression using the correct order of operations with our free BODMAS/PEMDAS calculator. Get step-by-step breakdowns to understand exactly how each expression is evaluated.