Free online tool

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.

Word operators: AND, OR, NOT, XOR, NAND, NOR, XNOR. Symbols: &, |, !, ~, ^, *, +. Use parentheses to group operations. Constants: 0, 1, TRUE, FALSE.
Examples

Input values

Variable controls appear here.

Truth table generator

Calculate the output for every possible combination of inputs.

Enter an expression and click Generate truth table.

Boolean operators

Boolean values are either true (1) or false (0).

OperatorSymbol alternativesMeaning
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.
NANDWord operatorThe inverse of AND.
NORWord operatorThe inverse of OR.
XNORWord operatorTrue 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

  1. Enter an expression using variable names such as A, B, and C.
  2. Connect variables using the supported logical operators.
  3. Select 0 (False) or 1 (True) for each variable.
  4. Click Evaluate expression to calculate one result.
  5. 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.

ABA AND B
000 (False)
010 (False)
100 (False)
111 (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.