Pretty much everyone has an opinion about carbohydrates. Some say eating carbs helps dieters avoid fats; others recommend a no- or low-carbohydrate diet to lose weight. The truth lies in between. A recent study clarifies what you need to know about this popular food group: The quality of the fiber in your diet should be your main concern.

Nutrition guidelines urge us to eat more fruits, vegetables and whole grains, all of which contain varying amounts and types of carbohydrates in the form of sugar, starch and fiber. These guidelines tend to offer little guidance about the specific foods we should focus on and what the ideal intake of fiber and starch should be.

Every eight-gram increase in fiber eaten daily reduced the risk of heart disease, type 2 diabetes and colorectal cancer by five to 17 percent.

Most people do not eat enough fiber, the review study, commissioned by the World Health Organization, discovered. The average person's intake is under 20 grams of fiber a day, but the benefits of eating fiber don’t really start until a person eats 25 to 29 grams of fiber daily. Eating even higher amounts of fiber results in even greater health benefits the study found.

Researchers at the University of Otago in New Zealand analyzed previous research on carbohydrates, reviewing studies dating as far back as 40 years. They concluded that the quality of carbohydrate is more important than the quantity of carbohydrate in a person’s diet. Foods high in fiber were linked to a reduction in diseases such as heart disease, stroke, type 2 diabetes and colorectal cancer, as well as an overall lower risk of death.

Fiber from fruits and vegetables and whole grains has a huge impact on health. People who ate the most fiber reduced their risk of death from all causes from 15 to 31 percent, compared to those who ate the least. Every eight-gram increase in daily fiber reduced the risk of heart disease, type 2 diabetes and colorectal cancer by five to 17 percent. Every 15-gram increase in whole grains decreased the risk of those diseases up to 19 percent. There was also increased protection against stroke and breast cancer.

The quality of carbohydrate is more important than the quantity of carbohydrate in a person’s diet.

Dieters will want to know that trendy low-carb or keto diets are generally low in fiber, proving the point that the number of grams of carbohydrate you eat isn’t nearly as important as the quality of the fiber your carbohydrates contain. It is entirely possible to eat a low-carb diet that is full of fiber, just as it is entirely possible to eat a low-carb diet that is full of sugar. Go for quality over quantity.

How can you make fiber work to your benefit? Plan your meals and snacks around fruits, vegetables, beans and peas, and whole grains — foods high in fiber. If keeping track of numbers is your thing, aim for at least 25 grams of fiber a day. The more the better.

The study was published in The Lancet.