Eating pasta could help you live longer, a new study suggests.

Following low-carb diets, such as Atkins, increases the risk of dying young, experts found.

Scientists say people who eat a “moderate” amount of carbs can expect to live four years longer. They suggest an optimum level of 50 to 55 percent of calories from carbohydrates, which are typically found in potatoes, pasta and bread.

Scientists from Brigham and Women’s Hospital in Boston analyzed data on 432,179 people. They found people who ate fewer carbs had a 20 percent higher risk of premature death.

And those who ate more than the recommended amount had a 23 percent higher risk. The findings are published in The Lancet Public Health journal.

Low-carb diets tend to result in a lower intake of healthy fruit, vegetables and grains — and more meat. This can lead to a loss of nutrients, harmful inflammation and biological aging.

The Atkins diet has proved popular with fad dieters because it can lead to rapid weight loss. It says meals should include full-fat dairy, eggs and meat, such as chicken, beef and bacon.

But those who replaced carbs with protein and fat from animal sources fared worst in the study.

While low-carb diets have long been touted as being great for weight loss, Harley Street nutritionist Rhiannon Lambert told The Sun that plans like Atkins have helped “fuel the myth” that carbs make you fat.

“The view that all carbohydrates should be cut from someone’s diet is quite simply wrong,” she said.

But the truth is that not all carbs are created equal.

Refined foods like white pasta, bread and pastries lack much of the fiber and other nutrients common to wholesome carbohydrates and provide quick-release energy that can leave us feeling deflated quickly.

Cutting all carbs out can leave you feeling tired and moody.

And that’s because our brains rely on the glucose found in carbohydrates as fuel.

Carbs also affect how much serotonin — the happy hormone — we produce.

So cut out all carbs and you could find yourself circling the drain.

“Just because carbs are not essential for survival, that doesn’t mean they aren’t beneficial,” said Rhiannon. “Many carb-containing foods are healthy and nutritious, such as fruit and vegetables.”

“These foods have all sorts of beneficial compounds and provide a variety of health benefits. Although it is possible to survive on a zero-carb diet, it is definitely a bad idea and not an optimal choice because you’re missing out on foods that science has shown to be beneficial.”

The scientists who have just published this latest study say people who insist on a low-carb diet should opt for veggies and nuts instead.

Study leader Dr. Sara Seidelmann said: “Low-carb diets that replace carbohydrates with protein or fat are gaining widespread popularity as a health and weight loss strategy.”

“However, our data suggests that animal-based low-carb diets, which are prevalent in North America and Europe, might be associated with shorter overall lifespan and should be discouraged.”

“Instead, if one chooses to follow a low-carb diet, then exchanging carbs for more plant-based fats and proteins might actually promote healthy aging in the long term.”