"These outbreaks are mostly caused by infection with a virus – most often norovirus or rotavirus – and spread easily from person to person, particularly if hands are not carefully washed after using the toilet or attending to nappy changes," said NSW Chief Health Officer, Dr Kerry Chant.

NSW Health urged the public to wash their hands and to stay at home if they had caught gastroenteritis.

Symptoms include nausea, vomiting, diarrhoea, fever, abdominal pain, headache and muscle aches, which can take between one and three days to develop and usually last between one and two days, sometimes longer.

Viral gastroenteritis is highly infectious and often spread via direct contact with an infected person.

A spike in gastroenteritis cases has prompted NSW Health to warn the public to wash their hands and stay home if they are sick. Credit:Edwina Pickles

"The best way to reduce your chances of getting viral gastroenteritis is to wash your hands thoroughly with soap and running water for at least 10 seconds, particularly after using the toilet, assisting someone with diarrhoea or vomiting, attending nappy changes and before preparing and eating food," he said.

"It is vital that if you or your family contract gastroenteritis that you stay home from work or keep a child home from school or childcare if they are sick for at least 24 hours after the last symptom of gastroenteritis.

People who are sick with gastroenteritis should not visit hospitals or aged care facilities to avoid spreading the virus in vulnerable settings, Dr Chant said.

"If your work involves handling food, or looking after children, the elderly or patients, do not return to work until 48 hours after symptoms have stopped.

"We urge infected people not to prepare food for others until at least 48 hours after they have completely recovered and then to double check their hygiene is perfect.