The fountain of youth could be as close as your neighborhood café or home pantry.

Coffee, a daily habit for 66% of American adults, packs a complex blend of antiaging and performance-boosting compounds. Our daily brew can help us live longer and better, according to a growing body of research.

Studies also suggest it can help boost mental and physical performance while fighting inflammation and staving off serious illnesses like heart disease, cancer, and diabetes, according to a recent study. A new study also suggests it has benefits to help lower the risk of dementia.

“Caffeine is one of the most powerful and one of the most consistent tools that we have for performance,” sports nutritionist Tom Coughlin, who wasn’t connected to the new study, told Business Insider.

However, not all coffee is the same when it comes to health benefits. Researchers say that certain types of coffee may be healthier than others, and too much can backfire.

Business Insider spoke with experts about the multiple ways coffee affects your brain and body. They explained how to drink coffee for the greatest benefits with the fewest side effects.

Your brain on coffee

Neuroscientist Agenor Limon loves to start the day with a cup of coffee. The daily ritual — grinding beans, heating water, and brewing — stimulates a full sensory experience leading up to that first sip.

“Coffee helps feed the brain with the aroma, the taste, and the moment,” Limon, a professor of neurology at the University of Texas Medical Branch, told Business Insider.

A close up of a fresh cup of espresso coffee

Caffeine is just one of the health-boosting compounds in coffee. 

Guido Mieth/Getty Images

As the molecules in coffee hit your system, they interact with important receptors in the brain associated with alertness, attention, and memory, according to Limon. It also affects the vascular system, supporting healthy blood flow in the brain and body.

New research suggests those benefits persist beyond the initial feel-good rush. A study published in JAMA in February found that people who drank two to three cups of coffee daily had a significantly lower risk of dementia.

Beyond the chemistry of coffee, its social, cultural, and sensory elements also benefit the brain, helping us unwind and stay present, according to Limon, who wasn’t part of the study.

“If we’re very rushed and distracted, we don’t focus on things. That’s a problem later in life,” Limon said.

Why coffee can be good for your health

Coffee is so complex that researchers are still trying to pinpoint exactly what makes it good for us, said Fang Fang Zhang, an epidemiologist and professor at Tufts University.

One of the biggest contenders is the main active ingredient: caffeine, a stimulant that increases metabolism and reduces inflammation.

Studies link coffee to a huge range of other benefits, too, including:

Lower risk of cancers, including breast cancer, colorectal cancer, and liver cancerReduced risk of heart disease, heart attack, and strokeImproved insulin sensitivity and lower risk of diabetesBetter mood and fewer symptoms of depression

Zhang and others have found that decaffeinated coffee isn’t linked to the same health benefits as regular coffee, strongly suggesting that the caffeine itself plays a role.

But caffeine isn’t the only interesting chemical in coffee. It’s also a rich source of polyphenols, plant-based compounds that help protect our cells from damage.

One such compound is called chlorogenic acid, and studies suggest it’s a powerful defense against inflammation, cell damage, and metabolic dysfunction.

For best results:

Stick to black coffee whenever possibleAim for 1-3 cups of coffee per dayCut off caffeine no later than early afternoonTake time to enjoy it

“It’s one of the most potent antioxidants that we know,” Coughlin said. “High doses of antioxidants can be very beneficial for us across loads of different areas within the body.”

And if you don’t like coffee, green and black tea also contain polyphenols that help fight disease. Tea contains less caffeine than coffee, making its effects less intense — potentially a better alternative if you’re sensitive to side effects.

Coffee also provides a small dose of fiber, a crucial nutrient for gut health. Most of us don’t get enough fiber, which helps feed the microbiome of symbiotic bacteria in our digestive system.

Taken together, the healthy compounds in coffee rank it among the best foods for longevity, alongside nutritional powerhouses like olive oil, seeds, and legumes.

However, drinking coffee isn’t an excuse to stop eating your veggies.

“I don’t think that’s the rescue for an unhealthy diet. Not one single food nutrient or beverage could save us,” Zhang said. “We definitely still need to think about how we’re going to consume an overall healthy diet. To have coffee is a great addition.”

Coffee to level up your fitness

As if antiaging benefits weren’t enough, coffee is also a performance-enhancing supplement in the gym and in the office. Coughlin said 95% of the athletes he works with have some form of caffeine in their game plan.

“It’s part of their strategy in terms of optimizing performance, making the brain work better, and making the body work better,” he said.

Caffeine speeds up reaction time and improves endurance, stamina, and strength. And you don’t need a pre-workout powder or other product to get the perks, since a cup of coffee works just as well for most people.

“One of the really beneficial things is the fact that this is actually a natural compound and you don’t necessarily need a supplement to get those benefits,” Coughlin said.

How much coffee is too much?

The benefits of coffee can come with tradeoffs, particularly in higher doses. Too much caffeine can cause symptoms like indigestion, jitters, anxiety, rapid heart rate, and headaches.

Side effects of caffeine overload can occur if you drink upward of 400 milligrams per day — about three cups of coffee — but may start earlier in people who are more sensitive to caffeine.

Extreme doses can be dangerous, but you’d need to drink more than a dozen cups of coffee in a short time period to be at risk.

a comically large cup of coffee on a table in front of a cafe

You can have too much of a good thing: side effects of a coffee overload include jitters and indigestion. 

Klaus Vedfelt/Getty Images

Most studies have found that the sweet spot for drinking coffee is one to three cups per day, and no more than five.

“It’s not the more, the better. We found that when you go beyond three cups, you don’t gain additional benefit,” Zhang said.

Timing is also crucial. One of the biggest drawbacks of coffee is that it can impair healthy sleep, which is also crucial for longevity.

Coughlin, the sports nutritionist, is a serious coffee lover with an impressive home-brewing setup, but said he limits his habit to no later than 2 p.m. It can take around seven hours to process half the caffeine you’ve consumed, and more than 10 hours to fully eliminate it.

“I want to make sure that I don’t have a massive amount of caffeine in my system when I go to bed,” he said.

The best way to drink coffee for health

To reap the biggest longevity boost from coffee, context matters.

Zhang found in her research that sweet coffee drinks loaded with milk don’t seem to have the same health benefits as plain coffee.

“It’s possible that adding sugar and saturated fat promote inflammation, so that cancels out the benefits,” Zhang said.