If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

The Logic of "If" vs. "Only if"

How are “if” and “only if” different?

Consider the following two statements:
  • I wear a hat if it’s sunny.
  • I wear a hat only if it’s sunny.
These two statements sound so similar...but their meanings are different. The test will challenge you on your understanding of this distinction.
You might be able to “feel” a difference between these two statements, since they deal with simple, everyday concepts. However, the test doesn’t make it easy for us, because instead of sunshine and hat wearing, it gives us abstract topics—like dunnarts and pigments and N-methylpridinium—that can be difficult to “feel”.


I wear a hat if it’s sunny.
Another way to put it:
If it’s sunny, then I wear a hat.
We can represent this with a conditional arrow, like this:
  • sunny hat
If it’s sunny, it guarantees that I wear a hat! It doesn’t matter if I’m sick, or sleeping inside all day—according to the truth of this statement, a sunny day is sufficient to know that I wear a hat. Or, on 100% of sunny days, I wear a hat.
Let’s also consider a statement that is logically equivalent to the first statement:
If I’m not wearing a hat, then it’s not sunny.
We can diagram this statement (sometimes called the contrapositive) like this:
  • not hat not sunny
If one of these statements is true, then the other one must be true, too!

Only if

Now, let’s look at an “only if” statement:
I wear a hat only if it’s sunny.
If this is true, then it means that if it’s a sunny day, I could wear a hat...but there’s no guarantee! However, we do know that if I’m wearing a hat, then it must be sunny. So here’s how we can diagram it:
  • hat sunny
Here’s the logically equivalent contrapositive statement, which confirms that if it isn’t sunny, then there’s no way that I’m wearing a hat:
  • not sunny not hat
In this example, my wearing a hat is a guarantee that it is sunny. But that doesn’t mean that sunniness guarantees that I’m wearing a hat!
We also cannot infer that if I’m not wearing a hat then it’s not sunny!
not hatnot sunny

Variations of “only”

Now that you can see how “only if” can be understood, let’s cover a few variations of “only” that you’re likely to encounter on the LSAT:
  • I only wear a hat if it’s sunny.
  • I wear a hat only when it’s sunny.
  • The only time I wear a hat is if it’s sunny.
  • Only sunny days will get me to wear a hat.
Notice that the placement of “only” in relation to “sunny” is quite different in each statement, and the order of the elements “hat” and “sunny” are different as well. However, logically, all four of these statements mean the same thing!
  • if I wear a hat sunny
Top Tip: Therefore, it can be very helpful to rephrase an “only” statement as either “X only if Y” or “If X, then Y”, so that you don’t confuse the elements involved. Each of the four statements above can be rephrased as: “I wear a hat only if it’s sunny” or “If I’m wearing a hat, then it’s sunny”.


I wear a hat if it’s sunny:
  • sunny hat
I wear a hat only if it’s sunny:
  • hat sunny
Top tip: Remember that what is indicated by “only” is the necessary condition...and that always goes on the right of the arrow, since it doesn’t guarantee anything. But also remember that what is indicated by “only” isn’t necessarily the element that’s closest to the word “only”! You’ll need to think about what the statement is actually telling you in order to determine what is required as opposed to what guarantees another event.

Your turn!

Here are some exercises for you to try on your own. We’ll give you a statement, and you’ll select the choice that matches. Try your best not to guess—review the notes above if you need to.
Example 1
I’ll go to the movie only if it’s opening night.
Choose 1 answer:

Example 2
There are only dogs playing in the water.
Choose 1 answer:

Example 3
Only medication taken daily can cure this disease.
Choose 1 answer:

Example 4
Last year, the only books I read were adventure stories.
Choose 1 answer:

Example 5
Political demagogues are the only people who seek to exploit others.
Choose 1 answer:

Want to join the conversation?

  • male robot hal style avatar for user Desmond
    I don't get it, I am only in 3rd Grade!
    (31 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Ruthleona Clement
    So just to be clear, is the statement "A only if B" the same as saying "A if and only if B"? Would their diagrams, including their contrapositives, be the same?
    (9 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Zach Unsell
    Even though I got all the questions right, I still feel like I can easily mess up an interpretation. What I don't like is that an "only if" statement can be written as an "if" statement.

    A "if" B.
    ["If" B, "then" A.]

    Only If:
    A "only if" B
    ["If" B, "then" A.] ... This phrasing can be used for "only if" and makes me think that it can, thus, perform the same functions as "if", but it cannot.

    ["If" A, "then maybe" B.] feels like a more appropriate phrasing to help people understand the difference between "if" and "only if".
    (8 votes)
    Default Khan Academy avatar avatar for user
  • old spice man green style avatar for user crazyrockbada
    i will donate to khan academy, if and only if Sal is crowned king of Khan. Is that the correct way to say the statement?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Gardner,Charlotte
    I'll eat apples, if and only if its sunday
    (2 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam red style avatar for user Adam Y. Soliman
      That's a bi-conditional which is different than what is discussed in the article despite the fact that the word "only" is in your sentence. The bi-conditional could be written like this: A<-->B. Now if your sentence said something like "I eat apples only if it's Saturday," that would be a conditional which you could write like this: A->B (I eat apples -> it is Saturday). Because you only eat apples on Saturday, it is safe to say if you're eating apples, then it's Saturday.
      (3 votes)
  • male robot hal style avatar for user JustinTheSmartGuy
    I only go to church,When it is sunday
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Priya Khetarpal
    its bit confusing. so we have to make a contrapositive first in order to understand its logical correctness?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • starky sapling style avatar for user Hanen Sobh

    Still a bit confused with these types of statements... The contrapositive aspects of a few examples were mentioned in the article and can be seen among the options listed to choose from. From my understanding, a contrapositive statement is basically the original statement flipped (in terms of the initial order of elements) and negated (if positive) and is ultimately the original statement but rephrased oppositely.

    Would the difference (in terms of what how we rephrase if/only if statements) be that with contrapositives, we're figuring out the OPPOSITE TRUE statement of the original v in this article, we're trying to figure out its (true) equivalent meaning without indicating its opposite?

    Any kind of info is greatly appreciated, thank-you!
    (2 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Shane Proctor
      I think it's best to think in terms of negation and interchanging terms here. Contrapositive means you are negating both terms (or the subject and predicate if that works better for you) and interchanging their positions.

      So A if B can be rewritten as:
      A --> B

      Contrapositive: ~B --> ~A

      The same rules apply for "only if." The trick is making sure your statements are plugged into a variable on the correct side of the conditional statement.
      (1 vote)
  • blobby green style avatar for user Ryclaire McCree
    It was kind of hard
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user ligiczhong
    the key in this topic is which element is decorated by word "only", it must have a smaller range than the another element without "only".

    and so we always infer from a small range to a larger range
    (1 vote)
    Default Khan Academy avatar avatar for user