Boolean Algebra Simplifier

Use A, B, C... for variables. Operators: & (AND), | (OR), ! (NOT), ^ (XOR), ( )

Type a Boolean expression such as A & B | (!A & B) and this tool evaluates it for every combination of its variables, returning the complete truth table with one column per variable and a final output column. It supports up to five variables and the operators & (AND), | (OR), ! (NOT) and ^ (XOR). Use the generated table to check a simplification you worked out by hand or to debug the logic you are writing.

How the truth table is generated

  1. 1

    Enter the expression

    Type your expression using single capital letters for variables and the symbols & (AND), | (OR), ! (NOT), ^ (XOR) and parentheses, for example `A & B | (!A & B)`.

  2. 2

    Variables are detected

    Each single capital letter counts as a variable, up to five in total. The table gets one column per variable, so five variables give 32 rows.

  3. 3

    Every combination is evaluated

    The expression is evaluated once per row, from all variables 0 to all variables 1, using the precedence NOT, then XOR, then AND, then OR. Parentheses override it.

  4. 4

    Check the output column

    The last column shows the value of the whole expression for that row. Compare it with your own table or with a simplified form to verify that they match.

Operators and precedence

Operation Symbol Example
AND & A & B
OR | A | B
NOT ! !A
XOR ^ A ^ B
Parentheses ( ) (A & B) | C

The expression is evaluated from the tightest to the loosest operator: NOT, XOR, AND, OR. Parentheses always win. Stick to the four symbols above, symbols such as · or + are not recognized and silently give a wrong table.

Example

Enter: A & B | (!A & B)

Truth table:

A B Output
0 0 0
0 1 1
1 0 0
1 1 1

The output column matches plain B. That is the kind of identity you can check in a few seconds: simplify by hand, then compare the columns.

Why a full truth table helps

  • Verify a simplification: simplify the expression by hand, then confirm that your simplified form has the same output column.
  • Debug logic: find the row where your expression disagrees with what you expect.
  • Learn the operators: watch how NOT, XOR, AND and OR combine without computing every row by hand.

Limits

  • Five variables at most: the table shows every combination, up to 32 rows. With more than five variables the table is not rendered, so split the expression into smaller parts.
  • Single capital letters: only the letters A to Z count as variables; lowercase letters and other characters are ignored.

Frequently Asked Questions

No. It evaluates your expression and builds the complete truth table, one row per combination of its variables (up to five). Use the table to verify a simplification you did yourself: if your simplified form produces the same output column, the two are equivalent.

Up to five, which gives at most 32 rows. Variables are single capital letters such as A, B and C. For more variables, split the expression into smaller parts.

& (AND), | (OR), ! (NOT) placed before its operand, ^ (XOR) and parentheses. Precedence from tightest to loosest is NOT, XOR, AND, OR. Symbols like · or + are not supported and can silently produce a wrong table.

No. This tool only accepts an expression. If your function is defined by a truth table, type the expression that produces it and compare the generated table.

Related Tools

Tool available in other languages