It might not be the fountain of youth, but a healthy diet has the potential to extend your life expectancy considerably. You could add over a decade to your life by embracing a better diet at age 20, a new study suggests, providing new meaning to the old saying, “You are what you eat.”

Poor diets are responsible for 11 million deaths and 255 million disability-adjusted life-years (or years of life lost due to early death plus the years lived with disability) annually. Eating too little of healthy foods, such as fruits and vegetables, and too much junk food, like sugar-sweetened sodas and fast food, are attributed to 20 percent of deaths around the world.

Even changing one’s diet at age 60 could add eight to nine more years of life, and over three years to the life expectancy of an 80-year-old, according to the model.

Using the Global Burden of Diseases study, scientists from the University of Bergen, Norway established a model that allows a person to estimate the effect of several types of dietary changes on their life expectancy, defined as the number of years a person of a certain age can expect to live before they die.

The model estimates that if a 20-year-old changed their diet from the typical Western diet consisting of large portions, too much sugar, too many calories, too much fat and salt, and not enough fruits and vegetables to an optimal diet, much like the Mediterranean diet, it could add over a decade to their lives (10.7 years for women; 13.0 years for men).

The biggest gains in life expectancy could be attained by eating more legumes, whole grains and nuts, while eating less red and processed meat.

You don’t have to start early. According to the model, even changing one’s diet at age 60 could add eight to nine more years of life and over three years to the life expectancy of an 80-year-old.

These healthy dietary changes are associated with reduced risk of death from cardiovascular disease, diabetes and cancer, diseases that are among the leading causes of death around the world.

“Understanding the relative health potential of different food groups could enable people to make feasible and significant health gains,” the authors write. “The Food4HealthyLife calculator could be a useful tool for clinicians, policy makers and lay-people to understand the health impact of dietary choices.”

The model is now an online tool called the Food4HealthyLife calculator. It can help you see how dietary changes may affect your life expectancy. Instructions for using the model can be found under the “Help” tab.

The study is published in PLOS Medicine.