A warm cup of coffee is a necessary part of the morning routine for millions of people around the world. And as the end of daylight saving time messes yet again with our sleep patterns, plenty of people in the U.S. may reach for an extra cup or two to power through the drowsiness. (Find out if you live in one of the best coffee cities in the U.S.)

But for some sleep-deprived souls, a cup of coffee is never the answer. No matter the delivery method, even a small amount of caffeine may give these people the jitters or keep them up all night. Why is it that caffeine affects people in such dramatically different ways? The answer, in part, lies in your genes.

“What we’re finding is that we have built-in genetic factors that help us with self-regulating our caffeine intake,” says Marilyn Cornelis, a caffeine researcher at Northwestern University in Chicago, Illinois. “It’s interesting how strong of an impact our genetics have on that.”

Caffeine 101 Nearly 90% of the United States population has at least one caffeinated beverage every day. Learn about the chemistry of caffeine, how it causes increased alertness and focus, and how caffeine is capable of causing overdoses.

Regular coffee drinkers will develop some level of tolerance to caffeine over time that can be reversed just by backing off the daily cup. But if you avoid coffee because it makes you anxious, sleepless, or nauseous, it could be due to variations as small as a single nucleotide in your DNA—the A, G, C and T of the genetic alphabet.

Regulating reactions

It all starts with how your body deals with the caffeine floating around in your system. That’s the job of your metabolism, and when it comes to caffeine, just two genes handle most of the work. CYP1A2 produces a liver enzyme that metabolizes roughly 95 percent of all ingested caffeine. AHR controls how much of that enzyme you produce. Together, these genes control how much caffeine circulates in your bloodstream, and for how long.

“For someone who has a genetic variant that leads to decreased caffeine metabolism, they’re more likely to consume less coffee compared to someone who has a genetic variant that leads to increased caffeine metabolism,” Cornelis says.

In other words, if you’re a quick metabolizer—or if you smoke, which boosts metabolism—caffeine won’t linger long enough to deeply affect your brain’s stimulus centers, so you might reach for another cup. But if you produce less of the caffeine-zapping enzyme, more of the chemical will circulate in your body for longer, meaning it can affect you for longer. (Is coffee actually good for you? Here’s the science.)

Attitude adjustment

A completely different set of genes has been implicated in how caffeine affects the brain’s activity and reward centers, as well as other side effects such as anxiety, insomnia and upset stomach.

Adenosine, one of the culprits behind morning drowsiness and the post-lunch slump, slows nerve activity and blocks the release of many feel-good substances in the brain, including dopamine. But when caffeine is circulating in your bloodstream, it easily takes the place of adenosine in receptors in your brain and elsewhere in your body, boosting wakefulness.

Expression of adenosine receptors is regulated by a gene known as ADORA2A, and numerous studies point to variants in this gene influencing your reaction to caffeine. It could be one reason some people experience insomnia even after a sip early in the day. It has also been found to play a role in anxiety—one 2008 study found that as little as 150 milligrams a day, or about as much caffeine as what’s in a Starbucks grande cappuccino—can cause disruptive anxiety in people with a certain variant of the gene. Another study implicated variations in adenosine receptors with panic disorder in some people.

It stands to reason that some people may avoid coffee simply because they associate it with negative side effects, as one study reported this April in Pharmacological Reviews.

“Caffeine intake varies widely as a function of both the country and individual,” writes Astrid Nehlig, a caffeine researcher with the French Institute of Health and Medical Research and author of the April report. “This variability might be partly linked to the fact that some persons experience side effects such as anxiety, tachycardia, and nervousness after caffeine intake.”

Variations in the dopamine receptor gene DRD2 may also influence your coffee devotion or aversion. And the gene ABCG2, which is involved in the transport of compounds across the blood-brain barrier, may affect how much caffeine reaches your central nervous system, Cornelis also found.

Wake up and sense the coffee

Aside from caffeine, coffee in particular can be a polarizing beverage due its taste and smell—another set of factors that are influenced by our genes.

In one study at the Monell Center in Philadelphia, taste and smell researcher Danielle Reed looked at the activity of genes known to be involved in bitter taste perception in a group of coffee drinkers. When given pure liquid caffeine to taste, subjects who drank more coffee on a daily basis rated the taste samples as more bitter than those who drank less.

When Reed’s group looked at the corresponding bitter-receptor genes, they found those genes to be more active in high-volume coffee drinkers. But other study participants completely lacked the gene variant to be able to taste caffeine’s bitterness. Does that mean those people could be expected to like coffee more?

“Only 15 percent of the bitterness of coffee is from caffeine, and the other 85 percent is from a whole other palette of bitter compounds,” Reed says. “There are a lot of different bitter receptors, but there are also a lot of different bitternesses in coffee. So, you’d have to look at the genetics on a coffee-by-coffee basis as well, because each coffee is different.”

Caffeine may also be influencing some people’s sensory pathways in ways we don’t yet fully understand, Reed notes. The compound not only binds to the surface of receptor cells, but it can also enter the cell, where its continued influence isn’t clear.

“If you’re very bitter-sensitive, though you might be more inclined to perceive the bitterness of coffee, you might still like it either through conditioning or caffeine’s pharmacology effects,” Reed adds.