Need is used for necessity.
- In summer we need to drink water more often.
- We nneed to eat in order to survive.
Don’t need to:
Not to do something, because there is no need for it.
- I don’t need to take my passport, ID card is accepted.
- You don’t need to enter the code before 6 pm.
Needn’t have :
For something was done but turned out to be unnecessary.
- I needn’t have taken warm clothes, it was hot.
- He needn’t have worn a tie. It was a casual event.
An obligation or rule.
- Pupils must wear a uniform. It’s a rule.
- Seat belts must be worn by all passengers.
For deduction when we are certain that something is true.
- John hasn’t eaten anything today, he must be hungry.
Obligation not to do something.
- Students mustn’t talk during the exam.
- You mustn’t tell Mom about the gift, it is a surprise.
3- Have to
An obligation from an external source.
- Lisa has to wear a uniform, the rule says so.
- He has to exercise more, the doctor says so.
Note: have to has the same meaning of have got to. But have got to is more informal.
- She has got to take the car to the garage today.
Don’t have to
No necessity to do something.
- We don’t have to take notes, we will get a summary.
- Men don’t have to wear a tie, but they can wear one if they like.