If you have seen the headlines touting the health benefits of coffee and wine—and you’re among the 61 percent of Americans who down a daily cup of java or the 31 percent of drinkers who prefer a glass of wine to other alcoholic beverages—you’ve probably been thrilled to watch former vices morph into virtues. But how good are the drinks for your health?

Some research shows that coffee and wine, when consumed in moderation, may have similar benefits, such as increasing life span, boosting blood flow, and diminishing the risk of depression. And coffee and red wine have been found to contain antioxidants, which may prevent disease.

But the beverages aren’t just bundles of antioxidants; that’s why they’re more fun to drink than a kale smoothie (for most of us, anyway). The question is how exactly coffee and alcohol can play a role in improving health. People who moderately drank any type of alcohol—red or white wine, beer, or spirits—were 30 to 35 percent less likely to have a heart attack than nondrinkers, according to Harvard University researchers who tracked more than 38,000 men over 12 years; other studies have found a similar effect in women. Drinking caffeinated coffee may help prevent Alzheimer’s disease, according to another study—which is attributed to the caffeine working in tandem with a compound in coffee to boost brain health. (If you drink only decaf, you still reap some benefit: Research has linked caf and decaf with a decreased risk of type 2 diabetes.)

Potential Downsides

Still, the news isn’t all good. In the short term, regular and decaf coffee can aggravate acid reflux. Caffeinated versions can exacerbate symptoms of anxiety disorders and insomnia, among other conditions—particularly in women, who tend to be smaller than men, as well as in people who metabolize coffee slowly. Too much red wine can cause weight gain; a five-ounce glass has 127 calories. Alcohol can be dehydrating, the main culprit behind hangovers. (But moderate coffee drinking, contrary to popular belief, is not dehydrating.) Over the long run, drinking the amount of caffeine in two to three 8-ounce cups of brewed coffee per day appears to increase bone loss that can lead to osteoporosis in postmenopausal women. And several types of cancer are more common in people who drink any amount of alcohol.

How Much to Drink

It might all come down to you. Research shows that the health benefits of coffee and wine differ greatly depending on how quickly your genes tell your body to metabolize those drinks. Until genetic testing is more common and you can pinpoint your limits, moderation and common sense are key. Translation: If you have or are prone to a condition that is exacerbated by drinking either beverage, skip it. If you take a medication that either beverage can interact with, ditto.

Coffee guidelines: Data suggest that most healthy adults can safely consume, daily, up to 400 milligrams of caffeine—the amount in around two to four cups of brewed coffee.  Pregnant women should keep it to less than 200 milligrams; kids, no more than 45 to 85 milligrams. (A 12-ounce can of cola has roughly 35 to 40 milligrams of caffeine.) According to the USDA, a 12-ounce cup of brewed coffee has 140 milligrams of caffeine. But the amount of caffeine in coffee can vary from brew to brew, depending on brew time, grind size, and other factors. For example, Starbucks' Pike Place Roast has roughly 260 milligrams in 12 ounces, while the same size Caffè Americano has about 150 milligrams.

Wine guidelines: Pregnant women should not drink any alcohol. If you’re at a high risk for cancer, talk to your doctor about alcohol intake. If you’re generally healthy, the American Cancer Society recommends no more than one drink per day for women and two for men. A “drink” is defined for wine as a 5-ounce serving, and the limit is per day, not a weekly average. So forget those huge goblets of pinot noir; instead, pour a few ounces. If that feels sparse, at least you have room for coffee.