1. Parse both formulas
The checker applies the displayed precedence rules and turns each proposition into a syntax tree. It reports formula-specific syntax errors with character positions.
Use up to 8 distinct variables across both formulas. Names such as P, rain, and road_wet are accepted.
Private by design: both formulas are parsed and evaluated on this device. They are not uploaded, stored, or placed in the page URL.
Your verdict and comparison truth table will appear here.
Press Check equivalence or use Ctrl/⌘ + Enter.
| Operation | Accepted input | Precedence |
|---|---|---|
| NOT | !P, ~P, ¬P, P', not P | 1 (highest) |
| AND | P & Q, P * Q, P ∧ Q, P and Q | 2 |
| XOR | P ^ Q, P ⊕ Q, P xor Q | 3 |
| OR | P | Q, P + Q, P ∨ Q, P or Q | 4 |
| Implication | P -> Q, P => Q, P → Q, P implies Q | 5 |
| Biconditional | P <-> Q, P <=> Q, P ↔ Q, P iff Q | 6 (lowest) |
Constants 0, 1, false, and true are accepted. Adjacent expressions imply AND: P Q means P ∧ Q, while PQ is one variable name. Parentheses override precedence; implication groups from right to left.
The checker applies the displayed precedence rules and turns each proposition into a syntax tree. It reports formula-specific syntax errors with character positions.
Variables from Formula A and Formula B form one ordered union. With n distinct variables, the complete comparison has 2n assignments.
Both formulas are evaluated under the same assignment. Matching output values support equivalence; a row with different outputs is a counterexample.
The formulas are equivalent exactly when there are zero counterexamples. A single mismatch is sufficient to prove they are not logically equivalent.
In symbols, A ≡ B exactly when v(A) = v(B) for every valuation v. Equivalently, the biconditional A ↔ B must be a tautology.
Limits and assumptions: this checker uses classical two-valued propositional logic. It supports up to 8 combined variables, 500 characters per formula, and 220 tokens per formula. Predicate logic, quantifiers, modal operators, and three-valued logics are outside its scope.
Definitions and the row-by-row comparison method follow OpenStax’s treatment of equivalent statements.
Editorial review: operator truth functions, parser precedence, shared-variable enumeration, constants, and representative equivalence laws checked by the Starlight Tools editorial team. Last reviewed: .
Compare P → Q with ¬P ∨ Q. If P is false, both formulas are true. If P is true, both formulas have the same value as Q. Their outputs therefore match on all four assignments.
The comparison table contains no counterexample, so P → Q ≡ ¬P ∨ Q. By contrast, P ∨ Q and P ∧ Q differ when exactly one variable is true; either such row disproves equivalence.
When formulas use different variable sets, every combined assignment still matters. For example, P is not equivalent to P ∨ Q because P = false, Q = true is a counterexample.
Two propositions are logically equivalent if they have the same truth value for every assignment of all variables occurring in either formula. Equivalent formulas can look different syntactically.
No. Equivalence requires a match on every possible assignment. However, one mismatching row is enough to prove non-equivalence because it supplies a counterexample.
Yes. The checker uses the union of variables from both formulas. A variable absent from one formula can still affect the other formula and therefore the equivalence verdict.
Yes. Formula A and Formula B are equivalent precisely when their biconditional is true on every assignment. The checker displays the two result columns and their row-by-row match directly.
No. Variable order changes only the order of truth-table rows. It cannot change whether the two formulas match on every assignment.
Yes. Two tautologies are equivalent to each other, as are two contradictions. A tautology is not equivalent to a contradiction or to a contingency.
The checker evaluates the single empty assignment. For example, true and 1 are equivalent, while true and false are not.
No. Parsing, truth-table evaluation, copying, and CSV creation happen locally in your browser. The tool does not transmit or save the entered formulas.