Boolean Expression Calculator

Analyze logic using operators and truth tables. See simplification, precedence, variable counts, and validation instantly. Built for classes, coding practice, exams, and digital design.

Enter Expression

Accepted operators: AND, OR, NOT, XOR, NAND, NOR, IMP, EQV, parentheses, and constants 0 or 1.

Example Data Table

Expression Manual Inputs Expected Output Interpretation
A AND B A=1, B=1 1 Both conditions must be true.
A XOR B A=1, B=1 0 XOR is true only when inputs differ.
NOT A OR B A=1, B=0 0 Negated A is false, and B is false.
A IMP B A=1, B=0 0 Implication fails only when true implies false.

Formula Used

The calculator applies Boolean algebra and precedence-aware parsing to convert your expression into Reverse Polish Notation, then evaluates each truth-table row.

  • NOT A = 1 when A = 0, otherwise 0.
  • A AND B = 1 only when A = 1 and B = 1.
  • A OR B = 1 when at least one input is 1.
  • A XOR B = 1 when inputs differ.
  • A NAND B = NOT(A AND B).
  • A NOR B = NOT(A OR B).
  • A IMP B = NOT A OR B.
  • A EQV B = 1 when both inputs match.

Canonical SOP joins all true-output minterms with OR. Canonical POS joins all false-output maxterms with AND.

How to Use This Calculator

  1. Enter a Boolean expression using variable names such as A, B, C, or input_1.
  2. Use supported operators like AND, OR, NOT, XOR, NAND, NOR, IMP, and EQV.
  3. Add parentheses when you want explicit grouping.
  4. Select manual 0 or 1 values for each detected variable.
  5. Press the calculate button to generate the evaluation, truth table, and canonical forms.
  6. Use the export buttons to save results as CSV or print to PDF.

FAQs

1. What does this calculator solve?

It evaluates Boolean expressions, builds a complete truth table, identifies whether the expression is a tautology or contradiction, and shows canonical SOP and POS forms.

2. Which operators are supported?

You can use AND, OR, NOT, XOR, NAND, NOR, implication using IMP or ->, equivalence using EQV or <->, parentheses, and constants 0 and 1.

3. How are variables detected?

Any identifier starting with a letter becomes a variable, unless it matches a reserved logic operator. Names like A, Input1, Gate_A, and flag are accepted.

4. What is a tautology?

A tautology returns 1 for every possible input combination. This means the expression is always true, regardless of the values assigned to its variables.

5. What is canonical SOP?

Canonical sum of products lists every minterm that makes the expression true. Each minterm contains all variables, either normal or negated, joined by AND.

6. Why limit the variable count?

Truth tables grow exponentially. Eight variables already create 256 rows, which is useful but still readable on a page and practical for exporting.

7. Can I use it for digital logic study?

Yes. It is helpful for digital electronics, discrete mathematics, circuit verification, homework checks, and understanding how operator precedence changes output.

8. Does the PDF export create a file automatically?

The PDF option opens your browser print dialog for saving as PDF. This keeps the page simple and works without server-side file generation.

Related Calculators

boolean algebra simplifierlogic circuit minimizerlogical expression parserlogic equation solvermodus tollens calculatorlogic gate simulatorexistential quantifier calculatorfirst order logic solverbitwise operation calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.