“Whether” and “if” can both introduce a yes/no question inside a sentence. But only if introduces a condition, and in some structures only whether is possible.
Both are possible: yes/no questions inside a sentence
After verbs like know, ask, wonder, decide, tell me, you can use either. Whether is a little more formal.
- I don’t know whether / if she’s coming.
- Tell me whether / if you need help.
Only whether
- Right before or not: I’m not sure whether or not he’ll agree.
- After a preposition (on, about, of...): It depends on whether we get the funding.
- Before to + verb: She hasn’t decided whether to apply for the job.
- To mean “it doesn’t matter if”: Whether you like it or not, the rule stays.
Only if: conditions
Use “if” when one thing depends on another: if A happens, then B happens.
- I’ll call you if I’m late.
- If it rains, we’ll stay inside.
- You can borrow my book if you return it tomorrow.