In moderation, caffeine can have beneficial effects. But in larger doses it can put your health, and in rare cases, even your life at risk.

Last month Davis Allen Cripe, a healthy teenager from South Carolina, died after downing a McDonald’s latte, a large Mountain Dew soda, and a highly caffeinated energy drink.

According to a South Carolina coroner, the mixture of beverages led to a “caffeine-induced cardiac event causing a probable arrhythmia.”

The coroner was careful to say that “this was not a caffeine overdose.”

But the incident has still raised questions about the safety of caffeine, especially when ingested in large amounts over a short period of time.

Caffeine overdose is quite rare.

It usually involves high doses of caffeine taken in powder or tablet form, not beverages.

The reason is simple.

“It’s very hard to get that much caffeine when you’re drinking beverages because of the time it takes to drink them,” Jennifer Temple, PhD, associate professor of exercise and nutrition sciences in the University at Buffalo School of Public Health and Health Professions, told Healthline.

The lethal dose of caffeine for most people, says Temple, is about 10 grams, although this varies from person to person.

A cup of coffee has around 100 to 200 milligrams of caffeine. An energy drink contains anywhere from 50 to 300 mg of caffeine. A can of soda typically has less than 70 mg.

So even with the most highly caffeinated energy drink, you would still have to drink around 30 of them in rapid succession to reach the 10 g range.

Chances are, if you tried to drink that much, your body would stop you before you reached toxic levels.

“Most of the time, if people have acute symptoms of caffeine toxicity, it starts with nausea and vomiting,” said Temple. “So usually that’s sort of protective because you just get sick and you throw up the caffeine before it becomes too toxic.”

With caffeine powder or tablets, though, you can ingest a large amount at the same time. A teaspoon of the powder has 3,200 mg of caffeine.

Around 90 percent of adults in the world consume caffeine daily — in the form of coffee, tea, soda, energy drinks, and other beverages. Even chocolate contains small amounts of caffeine.

Caffeine has many effects on the body, not all of them harmful.

“The research that we’ve done in our lab, and the research that has been done in many other labs around the world, shows that in moderate doses, caffeine is probably not harmful,” said Temple.

Some studies show that caffeine can increase alertness, mental energy, and concentration, especially in people who are tired.

And, of course, there’s the big one.

“The primary effect of caffeine, and the reason why people consume it, is that it counteracts fatigue,” said Temple.

Of course, the downside of using caffeine to stay awake is not being able to sleep.

At moderate doses — a couple of cans of soda or cups of coffee — caffeine increases a person’s blood pressure and decreases the heart rate.

Some people, though, can drink several cups of coffee a day and hardly feel the effects. Others have trouble sleeping after eating too much chocolate before bedtime.

Genetics may play a role in determining why some people are more sensitive to caffeine. Underlying health problems — like those that involve the heart — or medications can also lead to a stronger reaction to caffeine.

And people who consume caffeine less frequently may be able to tolerate it less.

Temple’s research also found that caffeine can affect boys and girls differently after puberty.

At toxic levels — especially when taken in a short time — caffeine can start to cause a number of unpleasant side effects: headache, nausea, vomiting, jitteriness, and irritability.

More severe effects of caffeine toxicity include abdominal pain, seizures, increased blood acid levels, irregular or fast heartbeat, and reduced blood flow to the heart — all of which increase your risk of dying.

Death by caffeine, though, is rare.

One study earlier this year identified 51 caffeine-related deaths.

Another review from this year, published in Food and Chemical Toxicology, found that 14 of 26 caffeine overdose reports resulted in death.

“Many of those [caffeine-related deaths] were associated with exposures on the order or 10 g of caffeine or more, which is quite a bit of caffeine,” study author Daniele Wikoff, PhD, a health sciences practice leader at ToxStrategies Inc., told Healthline.

One person who died ingested 51 g of caffeine.

“In many of these instances,” said Wikoff, “it was consumption of a large amount in a very small amount of time, often from a source like a caffeine pill or the powdered form of caffeine, rather than energy drinks or coffee.”

Even when people didn’t die, they still experienced many of the severe symptoms of caffeine overdose.

“Pounding a bunch of energy drinks in a short period of time,” said Temple, “even if it doesn’t result in death, can certainly result in heart problems or in something that’s going to require an emergency room visit.”

And again, some people seem to be more affected by caffeine than others, even at higher doses. That makes it difficult to predict who will have a bad reaction.

“The evidence does show that there were some individuals who are sensitive,” said Wikoff, “whether it’s somebody that has a condition that makes them more susceptible, something that interacts differently with the caffeine receptors, or perhaps they metabolize it differently.”

In one case, a person suffered cardiac arrest and died after ingesting only 240 mg of caffeine.

Researchers write that this case is unusual and may be related to preexisting conditions.

But as with the death of Cripe, chugging caffeinated beverages can sometimes have unexpected consequences — even when drinking less than 500 mg of caffeine, as Reuters reported that Cripe did.

“We’re not saying that it was the total amount of caffeine in the system,” Gary Watts, the coroner of Richland County, South Carolina, told Reuters. “It was just the way that it was ingested over that short period of time, and the chugging of the energy drink at the end was what the issue was with the cardiac arrhythmia.”

Energy drinks can also contain other stimulants like guarana, L-carnitine, and taurine that complicate how the body reacts.

So how much caffeine is safe?

The review by Wikoff and her colleagues found that less than 400 mg per day for healthy adults — or less than 2.5 mg per kilogram of body weight per day for healthy teens — is “acceptable.”

The American Academy of Pediatrics recommends that adolescents aged 12 to 18 years should not ingest more than 100 mg of caffeine per day. Younger kids should avoid it altogether.

Recent deaths or toxic reactions to caffeine offer another lesson for parents, teens, and others.

“Just because these products are legal doesn’t mean that overuse of them can’t be harmful,” said Temple.