Result
Valid means no row makes every premise true and the conclusion false.
Calculation history
History remains in this browser until cleared.
Try common logic patterns
De Morgan law
Compare two equivalent forms.
Implication identity
Rewrite implication using NOT and OR.
Exclusive OR
True only when inputs differ.
Biconditional
True when both values match.
Majority function
True when two or more inputs are true.
NAND construction
Build AND using NAND gates.
NOR construction
Build AND using NOR gates.
Parity check
True for an odd number of true inputs.
Supported logical operators
The parser accepts English names, mathematical symbols, and familiar programming notation. Parentheses may be nested. Variable names may contain letters, digits, and underscores.
| Operator | Accepted notation | Arity | Meaning | Precedence |
|---|---|---|---|---|
| NOT | ¬A, !A, ~A | Unary | Negates one value. | Highest |
| AND | A ∧ B, A && B, A * B | Binary | True only when both are true. | High |
| NAND | A NAND B | Binary | Negation of AND. | High |
| XOR | A ⊕ B, A ^ B | Binary | True when operands differ. | Medium |
| XNOR | A XNOR B | Binary | True when operands match. | Medium |
| OR | A ∨ B, A || B, A + B | Binary | True when either is true. | Medium |
| NOR | A NOR B | Binary | Negation of OR. | Medium |
| IMPLIES | A → B, A -> B | Binary | False only for true to false. | Low |
| IFF | A ↔ B, A <-> B | Binary | True when values are equal. | Lowest |
Boolean rules behind the calculator
Core definitions
AND: A ∧ B is true only when both values are true.
OR: A ∨ B is true when one or both values are true.
NOT: ¬A reverses the Boolean value of A.
XOR: A ⊕ B is true when exactly one value is true.
Implication: A → B is equivalent to ¬A ∨ B.
Biconditional: A ↔ B is true when the values match.
Important identities
De Morgan: ¬(A ∧ B) = ¬A ∨ ¬B.
De Morgan: ¬(A ∨ B) = ¬A ∧ ¬B.
Absorption: A ∨ (A ∧ B) = A.
Complement: A ∨ ¬A = 1 and A ∧ ¬A = 0.
Idempotence: A ∨ A = A and A ∧ A = A.
Double negation: ¬(¬A) = A.
How to use this calculator
- Enter a Boolean expression using variables and supported operators.
- Choose the display style, row order, variable limit, and table options.
- Select Calculate logic to parse the expression and create every truth-table row.
- Review classification, canonical forms, minterms, maxterms, and evaluation steps.
- Select Simplify to minimize eligible expressions.
- Open other tabs to compare expressions, validate arguments, simulate gates, or perform bitwise calculations.
- Use copy, CSV, JSON, and print controls to save results.
Understanding logic operations and truth tables
Boolean logic works with two states. These states are usually written as true and false, or one and zero. A logical expression combines variables with operators. Truth tables list every possible input combination and provide a complete way to inspect an expression.
A single variable has two assignments. Two variables have four assignments. Three variables have eight assignments. In general, an expression with n distinct variables has 2ⁿ rows. This calculator detects variables automatically and evaluates a parsed syntax tree for every assignment.
Classification of expressions
A tautology is true in every row. A contradiction is false in every row. A contingency is true in some rows and false in others. Satisfiability asks whether at least one true row exists. Unsatisfiability means no assignment can make the expression true.
Canonical forms and simplification
Canonical sum of products uses one minterm for every true row. Canonical product of sums uses one maxterm for every false row. These forms are systematic but may be long. Minimization removes unnecessary terms while preserving the same truth function.
For supported variable counts, this page applies a Quine-McCluskey style process. It groups minterms by one-bit count, combines compatible terms, identifies prime implicants, and selects a cover for required minterms.
Equivalence and argument validity
Two expressions are logically equivalent when their outputs match for every assignment. A single differing row proves non-equivalence. An argument is invalid only when a row makes every premise true and the conclusion false.
Logic gates and digital systems
Digital circuits implement Boolean operators with gates. NAND and NOR are universal gates. XOR appears in adders and parity checks. The gate estimator counts operator nodes and multiplies logical depth by the entered delay.
Bitwise operations
Bitwise operations process binary positions independently. They are common in masks, permissions, graphics, protocols, and embedded programming. Bit width controls NOT, rotations, overflow, and signed interpretation.
Logic calculator FAQs
Which variable names are allowed?
Names may begin with a letter and continue with letters, numbers, or underscores. Reserved operator words should not be used as variable names.
Can I enter 1 and 0?
Yes. The parser treats 1 as true and 0 as false. TRUE and FALSE are also supported.
What is the operator precedence?
NOT is first. AND and NAND follow. XOR and XNOR come next. OR and NOR follow. Implication and biconditional are lower.
Why should I use parentheses?
Parentheses remove ambiguity and make complex expressions easier to review, teach, and translate into circuits.
How many truth-table variables are practical?
Every extra variable doubles the row count. Twelve variables create 4,096 rows, which can be difficult to inspect.
What is a tautology?
A tautology is true for every assignment. A OR NOT A is a common example.
What is a contradiction?
A contradiction is false for every assignment. A AND NOT A is a common example.
What is a contingency?
A contingency is true for some assignments and false for others.
What proves non-equivalence?
One row with different outputs is enough to prove that two expressions are not equivalent.
What makes an argument invalid?
An argument is invalid when at least one assignment makes every premise true and the conclusion false.
Is simplification unique?
No. Different minimal expressions can represent the same Boolean function.
Why is exact simplification limited?
Exact minimization can grow rapidly in time and memory. The limit protects browser responsiveness.
Can NAND implement every function?
Yes. NAND is universal and can construct NOT, AND, OR, and every other Boolean function.
Can NOR implement every function?
Yes. NOR is also universal and can build complete logic networks.
What is XOR used for?
XOR is common in adders, parity checks, toggles, comparators, and error detection.
What is XNOR used for?
XNOR detects equality and is often used in comparators.
What does signed bitwise mode change?
It interprets the highest bit as a sign bit using two’s-complement rules.
What is logical right shift?
Logical right shift inserts zero bits from the left.
What is arithmetic right shift?
Arithmetic right shift preserves the sign bit for negative signed values.
What is rotate left or rotate right?
Rotation moves shifted-out bits back into the opposite side of the selected width.
Are results sent to a server?
Interactive calculations run in the browser. History is stored locally unless exported.
Can I save a truth table?
Yes. Use CSV, JSON, copy, or print to a PDF-ready layout.
What is a minterm?
A minterm is an AND term containing every variable once and matching one true truth-table row.
What is a maxterm?
A maxterm is an OR term containing every variable once and matching one false truth-table row.
What is a Karnaugh map?
A Karnaugh map arranges values in Gray-code order to reveal adjacent groups that can be simplified.
Does gate delay estimation replace circuit analysis?
No. It is educational. Real timing depends on hardware, loading, fan-out, wiring, and implementation.