A bad diet really can raise your risk of cancer. Here’s how.

These charts show how what you eat affects your cancer risk.

However much we might like to believe that a detox tea or a super-berry will prevent us from getting cancer, the truth is a more bitter pill: anyone can get cancer no matter what kind of lifestyle they follow, but eating healthy foods and exercising regularly is the best way to lower your risk.

But that’s so much less satisfying, isn’t it? “Eating healthy” is this ambiguous idea that might seem only tangentially related to cancer, whereas eating an antioxidant that supposedly blocks free radicals feels like much more direct action. And yet the truth is that just as many cancer cases are caused by poor diet as by drinking alcohol, and even more are tied to the excess body weight that comes with eating that poor diet.

Roughly two out of every five cancer cases in America are preventable by a modifiable risk factor, from alcohol consumption to physical inactivity and, of course, cigarette smoking. That’s more than 659,000 cases annually. Of those, a new study in the journal JNCI Cancer Spectrum estimates that more than 80,000 (at least in 2015) were attributable to suboptimal diet.

So what does that actually mean? How does diet influence our cancer risk? We’ll break it down for you.

cancer cases caused by poor diet
Colorectal cancer is on the rise, especially in younger generations. Infographic by Sara Chodosh

How do certain foods affect my cancer risk?

Most of the breakdowns of diet and cancer focus on seven major food groups: fruits, vegetables, whole grains, processed meats, red meat, dairy, and sugar-sweetened beverages (sugar science is complicated, since fruits also have plenty of sugar, so researchers focus on sweet drinks since they’re unequivocally bad for you). Most Americans—in fact, most people around the world—don’t eat the right amount of any of these kinds of food. We consume far too much sugar and red or processed meat without getting nearly enough fruit, veggies, whole grains, or dairy.

Some of those food groups have a very direct influence on our health. The fiber in fruits, veggies, and whole grains, for instance, feeds a robust gut microbiome. Processed and red meats contain various molecules that promote cancer. But other foods, like sugar, are cancer-inducing in a less direct way: they make us gain weight. People who are considered overweight can be perfectly healthy, but on average, being obese comes with increased health risks—including a higher risk of cancer.

cancer cases by dietary factor
Fat but fit is absolutely possible, but excess weight still has an impact. Infographic by Sara Chodosh

Here’s a more in-depth breakdown of how these foods influence our cancer risk, all courtesy of the World Cancer Research Fund’s thorough report on diet and cancer.

Whole grains

Processed grains, like those in white flour, don’t contain the whole grain kernel—but it’s the whole grain that contains all the nutrients. The bran and germ bits include nutrients like vitamin E, copper, zinc, and selenium, plus lignans and phytoestrogens that researchers think could have anti-carcinogenic properties. They’re also full of fiber, which feeds healthy gut bacteria, ferments into short-chain fatty acids that may help prevent cancer, and move your bowel contents along (which may decrease the chances that a mutagenic compound in your feces comes in contact with your intestinal cells).

All of this contributes to a healthy colon that’s low in inflammation. We hear a lot about inflammation and cancer—the basic idea is that inflammatory reactions are intended to kill potential invaders like bacteria, because generally your body is inflamed in response to a bodily threat. A cut on your hand, for instance, is less likely to get infected because your body produces chemicals that induce mutations in potential pathogens like bacteria. But those same chemicals damage your own cells. That’s not a problem on a small scale, but chronic inflammation ends up promoting cancer.

Diets low in whole grains tend to promote inflammation and lead to an unhealthy gut overall, which is why they’re primarily associated with colorectal cancer.

Dairy products

You might be used to thinking of dairy as bad because Americans have been told for decades that fat is evil. Fat is not wholly evil, and though it’s calorie-dense there are tons of dairy options that are lower in fat and quite healthy for you. For one, dairy is high in calcium, which research suggests could be protective for your colon (though it’s not clear exactly how). And then there are the lactic acid-producing bacteria that give yogurt and other fermented dairy products their characteristic tang. Those bacteria contribute to your gut microbiome and seem to inhibit cancer formation through a variety of pathways.

These factors all seem to help protect your colon cells from becoming cancerous.

There is one potential drawback to dairy (apart from saturated fat), which is that high calcium content might be associated with a slightly increased risk of prostate cancer. Greater milk consumption has been associated with a small elevation in levels of a growth factor called IGF-1, which in turn is associated with a higher risk of prostate cancer. For that reason, dairy isn’t often endorsed as wholly anti-cancer. On the other hand, calcium also appears to exert some protective effects by regulating vitamin D levels. Breast cancer risk seems to go down with higher calcium intake for this reason.

cancer cases by type diet
A balanced diet is the healthiest one. Infographic by Sara Chodosh

Processed and red meats

The carcinogenic effects of these meats are pretty much all tied to three types of molecules: heterocyclic amines, polycyclic aromatic hydrocarbons, and N-nitroso compounds. The first two form in red and processed meats during high-temperature cooking, while your colon produces the third when it’s exposed to high levels of heme iron (which is what gives red meat its hue). Processed meats also contain nitrates and nitrites, both of which may contribute to the formation of N-nitroso compounds.

These molecules contribute to cancer risk in multiple organs, including the colon, the stomach, and the pancreas, by directly causing mutations in cells that can add up over time.

Fruits and vegetables

Apart from all the aforementioned benefits of fiber, fruits and veggies also have tons of nutrients and phytochemicals that research suggests are anti-tumorigenic. These include everything from carotenoids to flavonoids to vitamins A, C, and E. A lot of the benefit from these compounds goes toward the various elements of your GI tract, from your mouth to your stomach to your colon. But they also help prevent others, like breast, lung, and bladder cancer, most likely through the same pathways.

Sugar-sweetened beverages

Unlike the rest of these dietary factors, sugar doesn’t have any direct cancer-causing or -preventing properties. Instead, it contributes by promoting weight gain. Though there are plenty of ways to get healthier if you’re overweight or obese (regular exercise can help your metabolism shift toward a heart-healthy level even if you don’t lose weight!), fat mass still contributes to cancer.

One method is that ol’ buddy inflammation. Body fat induces chronic inflammation through several pathways, including by directly producing pro-inflammatory chemicals, and is associated with higher levels of insulin, which can promote the excess cell growth that increases a person’s cancer risk.

Excess body fat also influences hormone levels, since fat cells are a significant storage site for hormones. This is especially true for postmenopausal women, who are no longer producing high levels of estrogens from their ovaries and thus get most of their sex hormone exposure from body fat.

Will eating healthier prevent me from getting cancer?

Yes and no. All of the mechanisms we’ve discussed so far do genuinely decrease your cancer risk, but it’s also important to know that a lot of what we know about how nutrition influences health comes from association studies. That means researchers look across a population to see, for example, who eats more fruits, and then figure out whether those people get fewer diseases like cancer. The trouble is that people who eat a lot of fruit probably also have other healthy habits, like exercising regularly, and they’re more likely to be of a higher socioeconomic status that affords them better healthcare.

This means that only taking one recommendation is unlikely to have a huge impact on your cancer risk. You can eat all the strawberries you want, but if you’re having bacon every day you’re unlikely to have a healthy colon. And if you’re a super-healthy eater, having a serving of bacon once a week as a treat isn’t going to greatly raise your cancer risk. But if you shift your whole diet toward more fruits, veggies, whole grains, and low-fat dairy—and away from red or processed meats and sugar—you have a better chance of staying healthy than if you ate carelessly. You’re even less likely to get cancer if you don’t drink alcohol or smoke, and if you get plenty of physical exercise.

Of course, many people follow all these recommendations and still get cancer. And some people will smoke and drink and eat chocolate bars every day of their lives and die at a ripe old age without ever developing cancer. It’s important to remember that neither end of that spectrum means that the recommendations are no good. Statistically, across an entire population, many tens of thousands fewer people would get cancer if everyone ate a healthy, balanced diet. And while cutting down on sugar and upping fiber intake isn’t a magical cancer prevention method, good nutrition definitely won’t do you any harm.