Meaning
1) have to + infinitive → obligation (necessary or required)
Use have to when something is necessary, required, or a rule.
I have to wear a uniform at work.
She has to finish the report today.
2) don’t have to + infinitive → no obligation (not necessary / choice)
Use don’t have to when something is not necessary. You have a choice.
You don’t have to stay late.
We don’t have to bring food.
3) can’t + infinitive → prohibition (not allowed)
Use can’t when something is not allowed or forbidden.
You can’t use your phone during the exam.
They can’t park here.
Important Differences
don’t have to ≠ can’t
don’t have to = no need / optional
can’t = not allowed / forbidden
Form
Affirmative
I / you / we / they have to + base verb
I have to work late.
He / she / it has to + base verb
He has to attend the meeting.
Negative (No Obligation)
I / you / we / they don’t have to + base verb
We don’t have to cook tonight.
He / she / it doesn’t have to + base verb
She doesn’t have to drive.
Notes:
have to is NOT contracted (I’ve to)
Negatives use do / does
Questions
Do I / you / we / they have to + base verb?
Does he / she / it have to + base verb?
Do you have to work tomorrow?
Does he / she / it have to + base verb?
Does she have to wear a uniform?
Quick Contrast
You have to wear a seatbelt. → It’s a rule.
You don’t have to come early. → It’s optional.
You can’t park here. → It’s not allowed.