New Zealand universities and dorm accommodation providers have been told they could face hefty fines following a gruesome case in which a student's decomposing body lay undetected in his room for weeks.

Education Minister Chris Hipkins said the teenager's fate, which emerged last month, showed voluntary standards aimed at caring for students in halls of residence had failed.

He said a mandatory code of practice would come into force in 2021, including fines of NZ$100,000 (€57,000) for breaches that led to a student's death or serious injury.

"The (voluntary) code has effectively broken down ... and now it's time for the government to be more involved," Mr Hipkins told Radio New Zealand.

Student Mason Pendrous, 19, was staying in privately run accommodation as he embarked on his first year of an e-commerce degree at Canterbury University.

His family contacted the university with concerns in late August after not hearing from him for four weeks but it was another month before his body was discovered on 23 September.

The case is being investigated by the coroner and an independent inquiry set up by Canterbury University.