Bad news for those following the ketogenic diet: Following a super low-carb diet may slash the number of years you live, according to new research published in The Lancet Public Health.

For the study, researchers had more than 15,000 people fill out self-reported questionnaires about their diet, including the foods they consumed and how much of it they ate. From this information, they were able to determine the amount of kilojoules they ate on average, along with how their main macronutrients-carbohydrates, protein, and fat-were broken down.

The researchers did not include people whose kilojoules teetered on extreme ends of the spectrum, or those eating less than 2,510kJ (600cal) or more than 17,572kJ (4,200cal).

After following the study participants for roughly 25 years, they concluded that a 50-year-old person who ate a moderate amount of carbs (50 to 55 percent of their kilojoules from carbs) would live an average of 4 years longer than someone who ate a super-low carb diet (less than 30 percent of their kilojoules from carbs) and roughly 2 years longer than a person following a traditional low-carb diet (30 to 40 percent of their kilojoules from carbs). That's why people on the ultra-trendy keto diet might want to pay attention-that eating plan is typically comprised of just 5 percent carbs.

That said, this research indicated high-carb diets were risky, too. People following moderate-carb diets were still estimated to out-live those getting more than 65 percent of their kilojoules from carbs by 1 year.

The silver lining? The type of foods they ate made a difference. For those following a low-carb diet, swapping those carbs for plant proteins rather than animal proteins resulted in a slightly reduced risk of earlier death.

Why can slashing your carb intake be dangerous?

Those extra kilojoules have to come from somewhere, right? The study authors explain that people who cut out carbs tend to replace them with fewer vegetables, fruits, and whole grains-all of which are loaded with disease-fighting phytochemicals, heart-healthy fatty acids, gut-filling fibre, as well as essential vitamins and minerals.

For example, many people following a keto diet tend to strip common fruits and vegetables out completely because they pack more carbs, replacing them with keto-friendly foods higher in kilojoules and fat-like processed meats (hello, bacon) or low-carb packaged snacks. Not all keto-lovers eat the same way, but a similar pattern tends to develop over time.

So even if you see some weight slip off when you dramatically slash your carbs, it could be doing damage to other parts of your body. Time and time again, research finds that eating too much red meat may lead to disease, while filling up on fruits and vegetables lowers that risk.

On the other end of the spectrum, high-carb diets tend to lean toward refined, processed carbs (think: white bread, sugary cereals, and sweetened drinks), which are known to trigger serious health conditions like obesity, type 2 diabetes, and heart disease.

The bottom line: Moderation is your friend

The average adult woman should get 45 to 65 percent of her kilojoules come from carbs, 10 to 35 percent from protein, and 20 to 35 percent come from fat. Obviously, this ratio will change depending on your age, gender, and activity levels-but striking a balance can help ensure that you eat all of the foods you need to a longer, healthier life.