The announcement comes after the body of 19-year-old student Mason Pendrous was discovered in the Sonoda a hall of residence at Canterbury University last month, at least four weeks after he died.
Hipkins said under urgent changes to the Education Act would make care of students consistent across the country, with a temporary code to be introduced for new year and a permanent one to be set up by 2021.
"Tertiary education providers could have complied with a voluntary code which was created in 2004, but the self-regulation approach has failed to maintain adequate and consistent standards across the board," he said.
"We are putting safeguards in place to prevent another tragedy like the one at the Sonoda student accommodation."
The law would also create new offences carrying maximum penalties up $100,000 for breaches that resulted in serious harm or the death of a student.
That fine would be faced by universities, even if they contracted out their accommodation to a third-party provider, Hipkins said.
Pendrous was only found in September when his friend climbed onto the roof at the halls of residence where the teenager lived and looked into his missing friend's room.
Pendrous was in his first year studying e-commerce and was living at Sonoda - a student hall of residence run by Campus Living Villages (CLV).
Investigations are being carried out by former High Court Judge Kit Toogood and police.