Hard as it may be to swallow, it's no secret that a diet of cakes, sweet treats and burgers will impact the waistline.

But research from the University of NSW suggests an unhealthy diet can also take a toll on the memory.

Research published in the Brain, Behaviour and Immunity journal showed rats on a diet high in fat and sugar had impaired memories after almost a week.

"Interestingly, our rats were not obese and these changes emerged at day five," research co-author Professor Margaret Morris said.


"So you don't have to be obese, you just have to eat poorly."

Prof Morris noted there was pressure in society to be thin yet not all thin people kept healthy diets.

Researchers placed groups of rats on different diets, including low-fat food with sugar water, low-fat food with water, cafeteria food with water and cafeteria food with sugar water.

All rats on the diets with high sugar and fat, including cake, chips and biscuits, showed deficits, Prof Morris said.

"It suggests you don't need to be eating high fat to get it, you can be eating high sugar," she said.

The affected animals showed a poorer ability to notice when an object had been shifted to a new location.

The rats also had inflammation in the brain's hippocampal region, which is linked to spatial memory.

"The rats with the biggest inflammation of the hippocampus had the biggest memory loss," Prof Morris said.

Data showed the memory damage was not reversed after the rats switched back to healthy diets, but Prof Morris said that was based on one experiment.

Scientists will attempt to establish how to stop the inflammation in the brains of animals with unhealthy diets.