Sport science students Alex Rossetta and Luke Parkin needed dialysis after they were given 100 times too much caffeine during the test in 2015.
The pair were given 30g of caffeine instead of 0.3g.
People have died from a caffeine overdose after consuming just 18g of the substance, Newcastle Crown Court heard.
Prosecutor Adam Farrer told the court the overdose “could easily have been fatal”, the Independent reported.
Rossetto reported short term memory loss and was kept in hospital for six days following the experiment. His classmate Parkin underwent two days of treatment.
Both of the second year undergraduates lost more than 10kg in weight following the incident.
Judge Edward Bindloss said the fact that the men were in good physical shape was a likely factor in their recovery.
Northumbria University had previously used caffeine tablets for the Wingate Test, which is used to test the effects of caffeine on athletic performance, but had switched to powder in recent years.
No risk assessment had been carried out before the experiment and calculations were carried out on a mobile phone, the court heard.
“The failures to follow basic health and safety requirements were cumulative, persistent, long-standing and systemic,” Farrer added.
“The university failed in its duty to ensure the safety of its students.”
Peter Smith, defending, said the university wanted to “emphasise that they take the welfare of their students and staff seriously”.
In addition to the £400,000 fine, the university has been ordered to pay more than £26,000 in costs and a £120 victim surcharge.