As modals of prohibition, MUSTN’T and CAN’T are both used to show that something is forbidden, prohibited or not allowed. They often express rules and laws.
“You can’t park here, sir.”
“Passengers must not talk to the bus driver.”
What is the difference between them? This area is heavily loaded with personal preference, often presented as correct or standard grammar.
“You must not eat those berries, they are poisonous.” (it’s imperative that you don’t eat them)
‘Can’t’ might sound ambiguous due to its other meanings and some users disapprove of this usage as being sloppy, ungrammatical and so on, whereas, to others, “mustn’t” often suggests “unethical” rather than “against the rules”.
“You can’t go into that restaurant without a tie.”
MUSTN’T often means that the action is prohibited, illegal or dangerous. It can be an order or a strong recommendation and is usually used when the obligation comes from the person who is speaking.
“You mustn’t let Grandpa lift that box because he has a bad back.” (not ‘can’t)
You’re driving in your car with your mom sitting next to you. Your phone rings and instinctively you reach to answer it. She looks at you sternly and says:
“You mustn’t use your phone.” (she probably sounds surprised because you’re trying to do the prohibited action)
You are being told what to do, your parent’s authority is greater than yours. “Mustn’t” is very categorical and strict, and language learners should use it with caution. It sounds like instructing a little child.
“You mustn’t answer back when someone scolds you. It’s rude.”
‘Must not’ often occur in public signs and notices indicating laws, rules and prohibitions. For stronger prohibition ‘must never’ can also be used.
“You must never walk on the railway line.” (not ‘can never’)
CAN’T expresses withholding permission and tells us that something is against the rules. You’re driving in your car but you have a friend sitting next to you this time. They don’t have any authority over you, you are equal.
“You can’t use your mobile phone while you’re driving, dude.” (it’s against the law)
“Can’t” is used that way in conversation a lot. In the news it is more common for an attention-grabbing headline to use the word “can’t” above an article that instead uses more formal words like ‘prevent’, ‘prohibit’, ‘have no authority’, etc.
“We can’t let it happen again!”
The meaning is focused on the fact that something is not allowed, rather than necessity to not do it.
“Some people think that home-schooled students can’t sit high school exams.” (mustn’t would not fit here)
‘Mustn’t’ is stronger than ‘can’t’, and more authoritative, whereas ‘can’t’ is more informal. ‘Mustn’t’ is often used as a moral imperative: you mustn’t say such things.
“You must not call them so late.” (can’t would sound odd here)
“Mustn’t” is also used to talk about thinks you need to avoid doing. “I mustn’t be late for work this morning” sounds like there is an external pressure on you about the time keeping.
“I mustn’t drink too much beer at this party.” (I don’t think it’s a good idea)
Mustn’t can also be used to mean “it would be bad if this thing happened, so I don’t want it to happen”.
“Brexit mustn’t break UK jobs machine.” (if it happened it would be a disaster).
“Mustn’t” isn’t used very often in the US. You say “You shouldn’t do that”, “You can’t do that”, “Don’t do that”, etc. instead.
“Perhaps it’s used more in BrE but it sounds antiquated and almost childish.”
Non-native speakers use “mustn’t” far too much, unaware of the really strong connotations the word has.
“The employees mustn’t wear casuals.”
You can always tone it down with “shouldn’t” or use an imperative, maybe sweetened with “please”.
“Please don’t walk on the lawn.”