Conditional statements (if–then): definition, truth table, examples and the biconditional
A conditional statement says “if p, then q”, written p → q. The part after “if” is the hypothesis and the part after “then” is the conclusion. It is false in only one case, when the hypothesis is true and the conclusion is false. “p if and only if q”, the biconditional, adds the reverse.
This guide gives the definition and the truth table, explains why a false hypothesis makes the whole statement true, shows how to turn everyday and geometry sentences into if–then form, and covers the biconditional and the truth table of “if and only if”. Every claim that two statements mean the same thing links to a free checker that tests them on every row of their truth table.
What is a conditional statement?
A conditional statement joins two statements, a hypothesis p and a conclusion q, into the claim “if p, then q”. It is written p → q, and sometimes p ⇒ q, and read “if p then q” or “p implies q”.
- The hypothesis comes after “if”. It is also called the antecedent.
- The conclusion comes after “then”. It is also called the consequent.
In “if it is raining, then the ground is wet”, the hypothesis is “it is raining” and the conclusion is “the ground is wet”. The statement does not say that it is raining, and it does not say that the ground is wet. It says only that the first never happens without the second.
In logic the operator is called implication, and the implication page has its tables and notations.
The truth table of a conditional statement
A conditional has two parts, each true or false, so there are four rows. Row 0 has both false:
| # | p | q | p → q |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | TRUE |
Computed by the Tangibool engine
| Row | p (hypothesis) | q (conclusion) | p → q | Why |
|---|---|---|---|---|
| 0 | F | F | T | The hypothesis did not happen, so the statement was not tested. |
| 1 | F | T | T | Same: no hypothesis, nothing broken. |
| 2 | T | F | F | The hypothesis happened and the conclusion did not: the one way to break it. |
| 3 | T | T | T | The hypothesis happened and so did the conclusion. |
The truth table generator gives the same four rows with a plain-English reading. Only row 2 is false, so p → q means the same as “not p, or q”: p → q is equivalent to ¬p ∨ q.
Why a false hypothesis makes the statement true
Read a conditional as a promise. A parent says: “If you finish your homework, then you can play outside.” The promise is broken only if the homework is finished and play is not allowed, which is row 2. If the homework is not finished, the promise is not broken whatever happens, so the statement still stands. That is rows 0 and 1.
A statement that is true only because its hypothesis is false is called vacuously true. “If 2 + 2 = 5, then the Moon is made of cheese” is true, because its hypothesis never holds. The vacuous truth page shows where this matters in practice, for example in rules that no input ever triggers. In symbols: once p is false, p → q holds for every q, which is why ¬p → (p → q) is true on every row.
Turning sentences into if–then form
Most conditionals in textbooks, contracts and code reviews do not start with “if”. Each of these is p → q, with p the hypothesis:
| You read | Hypothesis p | Conclusion q | If–then form |
|---|---|---|---|
| All squares are rectangles. | it is a square | it is a rectangle | If a shape is a square, then it is a rectangle. |
| Whales are mammals. | it is a whale | it is a mammal | If an animal is a whale, then it is a mammal. |
| The alarm sounds whenever the door opens. | the door opens | the alarm sounds | If the door opens, then the alarm sounds. |
| You may board only if you have a ticket. | you board | you have a ticket | If you board, then you have a ticket. |
| A ticket is required to board. | you board | you have a ticket | If you board, then you have a ticket. |
| Passing the exam is sufficient for the certificate. | you pass the exam | you get the certificate | If you pass, then you get the certificate. |
| Being over 18 is necessary to vote. | you vote | you are over 18 | If you vote, then you are over 18. |
| The match goes ahead unless it rains. | it does not rain | the match goes ahead | If it does not rain, then the match goes ahead. |
| No reptiles are mammals. | it is a reptile | it is not a mammal | If an animal is a reptile, then it is not a mammal. |
Three patterns cause most of the mistakes:
- “Only if” introduces the conclusion, not the hypothesis. “p only if q” is p → q. Reading it as q → p reverses the statement, and the equivalence checker shows the two differ, with the counterexample p = F, q = T. The necessary and sufficient pitfall and Lesson 5 drill the difference.
- “Necessary” points backwards. “q is necessary for p” means you cannot have p without q, which is p → q. “Sufficient” points forwards: “p is sufficient for q” is also p → q.
- “Unless” means “if not”. “p unless q” is “if not q, then p”, which comes to p ∨ q: at least one of them happens. When “unless” states an exception in a rule, such as “members may enter unless banned”, it is read as “member and not banned”; the page on “unless” covers both readings.
Examples of conditional statements
| Conditional statement | Hypothesis | Conclusion | True or false |
|---|---|---|---|
| If a number is divisible by 4, then it is even. | divisible by 4 | even | True |
| If a number is even, then it is divisible by 4. | even | divisible by 4 | False: 6 is even and not divisible by 4. |
| If x + 3 = 5, then x = 2. | x + 3 = 5 | x = 2 | True |
| If x² = 9, then x = 3. | x² = 9 | x = 3 | False: x = −3 also works. |
| If two angles form a linear pair, then they are supplementary. | linear pair | supplementary | True |
| If a polygon is a triangle, then its interior angles add up to 180°. | triangle | angles add up to 180° | True (in plane geometry) |
| If a quadrilateral has four sides of equal length, then it is a square. | four equal sides | square | False: a rhombus that is not a square. |
| If an animal is a whale, then it is a mammal. | whale | mammal | True |
| If 2 + 2 = 5, then the Moon is made of cheese. | 2 + 2 = 5 | Moon is cheese | True, vacuously |
To show a conditional is false, one counterexample is enough: a case where the hypothesis is true and the conclusion is false. To show it is true, you need an argument that covers every case.
Conditional statements in geometry
Geometry courses use conditionals for theorems and postulates. “If two angles form a linear pair, then they are supplementary” is a theorem; “if two points are distinct, then exactly one line passes through them” is a postulate.
Definitions are different: a good definition works in both directions, so it is a biconditional. “An angle is a right angle if and only if it measures 90°” says both “if an angle is a right angle, then it measures 90°” and “if an angle measures 90°, then it is a right angle”. That is the usual test of a definition in a geometry course: write it as a conditional, reverse it, and check that the reversed statement, the converse, is also true. If it is, the definition can be written with “if and only if”.
The reversed statement and its relatives, the inverse and the contrapositive, have a guide of their own: converse, inverse and contrapositive, with the truth table that shows which of them always agree with the original.
The biconditional: “if and only if”
A biconditional, p ↔ q, says that p and q are either both true or both false. It is read “p if and only if q”, often shortened to “p iff q”, and also written p ⇔ q. It is the conditional in both directions:
| # | p | q | p ↔ q | p → q | q → p |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | TRUE | TRUE | TRUE |
| 1 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 3 | TRUE | TRUE | TRUE | TRUE | TRUE |
Computed by the Tangibool engine
p ↔ q is true on rows 0 and 3, where p and q agree, and false on rows 1 and 2. Its column is true exactly where both p → q and q → p are, so p ↔ q means (p → q) ∧ (q → p). It also means (p ∧ q) ∨ (¬p ∧ ¬q), “both or neither”, and its negation is exclusive or: ¬(p ↔ q) is p ⊕ q. In circuits the same function is the XNOR gate.
A conditional and a biconditional differ on one row. On row 1, with p false and q true, the conditional is true and the biconditional is false; the equivalence checker gives exactly that counterexample. So “I will go if it is sunny” allows going on a cloudy day, but “I will go if and only if it is sunny” does not.
The biconditional page has more. One detail: (p ↔ q) ↔ r and p ↔ (q ↔ r) have the same truth table, so the biconditional is associative, but Tangibool's tools still ask for the brackets in a chain, because a reader cannot tell which reading was meant.
Negating a conditional statement
The negation of “if p, then q” is not another conditional. It is the one situation in which the conditional fails: “p and not q”. The negation of “if it rains, then the match is cancelled” is “it rains and the match is not cancelled”, and ¬(p → q) is equivalent to p ∧ ¬q. A common slip is to answer with “if not p, then not q”, which is the inverse, a different statement; the guide on converse, inverse and contrapositive shows the row where they part.
Reasoning with conditional statements
- Modus ponens. From “if p, then q” and “p”, conclude “q”. It is the most used step in proofs, and the argument validity checker confirms that it is valid. See the worked example.
- Chains. From “if p, then q” and “if q, then r”, conclude “if p, then r”, the hypothetical syllogism: ((p → q) ∧ (q → r)) → (p → r) is true on all eight rows.
- Two hypotheses. “If it rains, then if it is cold, it snows” means “if it rains and it is cold, it snows”: p → (q → r) is equivalent to (p ∧ q) → r, a law called exportation.
- Grouping. A chain of arrows groups to the right: p → q → r means p → (q → r). Grouping it to the left gives a different statement, which is false when all three parts are false.
Conditional statements in programming and in grammar
The same words mean related but different things outside logic:
- In programming, a conditional statement is an instruction such as
if (c) { a } else { b }: it chooses what to do, rather than being true or false. The logic inside it is still Boolean. “If c then a, else b” as a statement is (c → a) ∧ (¬c → b), which is the same as (c ∧ a) ∨ (¬c ∧ b). Most languages have no implication operator, so p → q is written!p || q; the pages on Python and JavaScript show it. - In English grammar, conditional sentences are classed by time and likelihood: zero (“if you heat ice, it melts”), first (“if it rains, we will stay in”), second (“if I won, I would travel”) and third (“if I had known, I would have come”). Logic keeps only the true-or-false core of the zero and first kinds; the second and third talk about situations that are not real, which a truth table cannot capture.
Common mistakes
- Thinking a false hypothesis makes the statement false. It makes it true. Only “true hypothesis, false conclusion” breaks a conditional.
- Reversing “only if”. “p only if q” is p → q.
- Treating “if” as “if and only if”. “If it is sunny, I will go” says nothing about cloudy days. Everyday speech often means the stronger biconditional; logic and contracts take the words literally.
- Negating a conditional with another conditional. The negation of p → q is p ∧ ¬q.
- Proving a conditional with examples. Cases where both parts are true support a conditional but do not prove it; a single case with a true hypothesis and a false conclusion disproves it.
Check your own conditional statements
- Give each part a letter: p for the hypothesis, q for the conclusion.
- Open the truth table generator and type
p -> q, or a longer statement such as(p AND q) -> r. It shows every row and reads the statement back in plain English. - To check whether two wordings say the same thing, put both into the equivalence checker, for example
p -> qandNOT p OR q. If they differ, it gives the row.
Type the arrow as -> or →, and “if and only if” as <-> or ↔. The fat arrow => and <=> are refused with a message, because they mean different things in different programming languages.
Frequently asked questions
What is a conditional statement?
A statement of the form “if p, then q”, written p → q. It is false only when p is true and q is false.
What are the hypothesis and conclusion of a conditional statement?
The hypothesis is the part after “if” and the conclusion is the part after “then”. In “if it rains, the ground is wet”, the hypothesis is “it rains” and the conclusion is “the ground is wet”.
What is the truth table of a conditional statement?
p → q is true on three rows and false on one: true when p and q are both false, true when p is false and q true, false when p is true and q false, and true when both are true.
Why is a conditional statement true when the hypothesis is false?
Because it was never put to the test: a promise “if you finish, you can play” is not broken by someone who does not finish. Only a true hypothesis with a false conclusion breaks it.
What is a biconditional statement?
A statement “p if and only if q”, written p ↔ q. It is true when p and q have the same truth value and false when they differ, and it means both p → q and q → p.
What is the truth table of “if and only if”?
p ↔ q is true when both parts are true or both are false, and false when exactly one of them is true.
How do you write a conditional statement in if–then form?
Find the condition and the result, then write “if (condition), then (result)”. “All squares are rectangles” becomes “if a shape is a square, then it is a rectangle”, and “p only if q” becomes “if p, then q”.
What is an example of a conditional statement in geometry?
“If two angles form a linear pair, then they are supplementary.” Definitions, such as “an angle is a right angle if and only if it measures 90°”, are biconditionals.
What is the difference between a conditional and a biconditional?
A conditional works in one direction and a biconditional in both. They differ when the hypothesis is false and the conclusion true: the conditional is true there and the biconditional false.
Is a conditional statement the same as an implication?
Yes, in logic. Implication is the name of the operator, →, and a conditional statement is a statement built with it.
Related pages
- Guides: converse, inverse and contrapositive; necessary and sufficient conditions
- Operators: implication (→) and biconditional (↔), with implication vs biconditional
- Lesson 5: if, only if, unless and Lesson 8: arguments and validity
- Glossary: antecedent, consequent, vacuous truth
- Laws: implication elimination and biconditional elimination
- Practice: English to logic, with answers
Written by Muaz Notiar. The Tangibool engine (semantics tangibool-semantics/1, engine 1.0.0) computed the 2 truth tables marked “Computed by the Tangibool engine”, and the 17 tool results the guide links to were re-run through the tools' own code in the build of and match what the text says. © 2026 Foreranger LTD.