Skip to content

Biconditional (↔, if and only if): truth table and examples

The biconditional A <-> B, read “A if and only if B”, is TRUE when A and B have the same value and FALSE when they differ. It is implication in both directions at once, and the same function as the XNOR gate.

The table has two TRUE rows, where A and B agree, and two FALSE rows, where they differ. The second table below writes the same function with AND, OR and NOT, (A AND B) OR (NOT A AND NOT B), and the columns match; the biconditional elimination law proves it, and the XNOR page shows the gate with the same table. A <-> B is also (A -> B) AND (B -> A), which is where the name comes from.

The parser accepts <-> and ↔; <=> is rejected with a repair, and so is ==, whose message points to <-> for “both sides have the same value” and to the Compare workbench for comparing two formulas. A chain A <-> B <-> C is rejected on purpose, although both groupings, (A <-> B) <-> C and A <-> (B <-> C), have the same table: the chain is easy to misread as “all three are equal”, yet either grouping is TRUE when an odd number of inputs are TRUE, so it is FALSE when all three are FALSE. The parser therefore asks for brackets, offers both groupings as repairs, and never groups a chain silently.

In rules and specifications the biconditional expresses “exactly when”: the discount applies if and only if the card is valid, so a valid card without a discount, and a discount without a valid card, are both violations. That is stronger than the one-way “if”, and the comparison page sets A -> B and A <-> B on one table to show the extra FALSE row. Keep it apart from logical equivalence: A <-> B is a formula with its own table, while “F is equivalent to G” is the claim that F <-> G is a tautology.

Accepted spellings

<-> ↔

Wordsa <-> b
Programminga <-> b
Mathematicala ↔ b
Algebraa ↔ b

A ↔ B: A <-> B

A <-> B
#ABf
0FALSEFALSETRUE
1FALSETRUEFALSE
2TRUEFALSEFALSE
3TRUETRUETRUE
Beginnerf is true exactly when A and B have the same value (both true or both false).
In every other case, f is false.
About the operators:
- A biconditional (↔) is true when both sides have the same value.
Intermediatef is true exactly when A and B have the same value (both true or both false).
In every other case, f is false.
Advancedf is true exactly when A and B have the same value (both true or both false) [biconditional ↔].
In every other case, f is false.
Formal notation: A ↔ B
A <-> B A <-> B A B f ↔
A <-> B A <-> B A B f ↔

Rewritten with AND and OR: (A AND B) OR (NOT A AND NOT B)

(A AND B) OR (NOT A AND NOT B)
#ABf
0FALSEFALSETRUE
1FALSETRUEFALSE
2TRUEFALSEFALSE
3TRUETRUETRUE
Beginnerf is true exactly when at least one of the following holds (both may hold):
1. both A and B are true
2. A is false and B is false
In every other case, f is false.
About the operators:
- OR is inclusive: it is true when at least one part is true, including when several are.
- AND is true only when all of its parts are true.
- NOT reverses a value: true becomes false and false becomes true.
Intermediatef is true exactly when at least one of the following holds (both may hold):
1. both A and B are true
2. A is false and B is false
In every other case, f is false.
Advancedf is true exactly when at least one of the following holds (both may hold) [inclusive disjunction ∨]:
1. both A and B are true [conjunction ∧]
2. A is false and B is false [conjunction ∧]
In every other case, f is false.
Formal notation: (A ∧ B) ∨ (¬A ∧ ¬B)
(A AND B) OR (NOT A AND NOT B) (A AND B) OR (NOT A AND NOT B) A B f OR AND AND NOT NOT
(A AND B) OR (NOT A AND NOT B) (A AND B) OR (NOT A AND NOT B) A B f OR AND AND NOT NOT

The common slip

Writing = or == between two formulas to say they are equivalent. The language has no = operator; A <-> B is the biconditional formula, and to test whether two formulas always agree you compare them with the equivalence checker, which reports the first differing row when they do not.

Questions

What is the difference between A -> B and A <-> B?

A -> B is FALSE only when A is TRUE and B is FALSE; A <-> B is also FALSE when A is FALSE and B is TRUE. The biconditional adds the converse, so it has one more FALSE row.

Is the biconditional associative?

As a mathematical fact, yes: (A <-> B) <-> C and A <-> (B <-> C) have the same table. The parser still requires the brackets, because readers rarely know this and the two groupings read differently; the equivalence checker will confirm it for you.

Related

Guides

Laws

Tools

See also

Operators and gates

Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.