Modals for obligation (must, have to, need to)

ModalsMustHave toNeed to
UsesExpressing strong obligation (positive/negative), expressing rules (positive/negative). Expressing obligation, asking about obligations (positive), expressing optional actions (negative). Expressing obligation (positive/negative), asking about obligations (positive)
FormalityFormalFormal / Informal Informal
Examples
Expressing strong obligation (positive):
You must pay your taxes.
Expressing strong obligation (negative):
You must not leave before the meeting ends.
You mustn’t tell the boss about this. 
Expressing rules (positive):
Employees must wash their hands. 
Expressing rules (negative):
Employees must not wear hats indoors.
NOTE- The contraction (mustn’t) is rarely used when talking about rules. 
Expressing obligation:
You have to give me the report by noon. 
Asking about obligations:
Do I have to print the entire document?
Expressing optional actions:
You do not have to work today. (You can, but it isn’t required). 
Expressing obligation (positive):
You need to take your time. 
Expressing obligation (negative):
You don’t need to rush. 

Asking about obligations (positive):
Do I need to email you?