Everyone knows someone who drinks an espresso after dinner and sleeps soundly, and someone else who gets palpitations from a single morning cup. That difference is not imagination or willpower. A substantial part of it is one liver enzyme and the gene that codes for it, and the research on this is among the more interesting threads in coffee science, partly because the studies do not entirely agree.
The enzyme
Roughly 95% of the caffeine you consume is metabolised by a single enzyme in the liver, cytochrome P450 1A2, known as CYP1A2. How fast that enzyme works determines how long caffeine stays in your bloodstream and therefore how long and how strongly you feel it.
That concentration in one pathway is unusual and it is what makes caffeine such a well-studied example of pharmacogenetics. Many drugs are cleared by several enzymes in parallel, so variation in any one of them has a diluted effect. With caffeine, variation in CYP1A2 translates almost directly into variation in exposure, which is why the differences between people are so large and so noticeable.
The gene coding for this enzyme has a common variant at a position designated rs762551. People homozygous for the CYP1A2*1A allele are classified as rapid caffeine metabolisers. Carriers of the variant CYP1A2*1F allele are slow metabolisers. Both are ordinary, common variants, not defects.
The functional consequence is large. Nehlig's review in Pharmacological Reviews[1] documents caffeine half-lives ranging from roughly two hours in the fastest metabolisers to eight hours or more in the slowest, which means a given cup of coffee can represent a fourfold difference in total exposure between two people.
The study that made this famous
The best-known investigation is by Cornelis, El-Sohemy, Kabagambe and Campos, published in JAMA in 2006[2]. They studied 2,014 people who had suffered a first non-fatal myocardial infarction and 2,014 population-based controls matched for age, sex and area of residence, all living in Costa Rica between 1994 and 2004, and genotyped every participant for CYP1A2.
The result was a clear gene-by-diet interaction. Among carriers of the slow *1F allele, the multivariate-adjusted odds ratios for heart attack associated with drinking 2 to 3 cups and 4 or more cups of coffee a day were 1.36 and 1.64 respectively. Among people with the rapid *1A/*1A genotype, the same intakes produced odds ratios of 0.78 and 0.99.
It is worth being clear about what a case-control design can and cannot establish, because this study's design is weaker than its result is striking. Cases were people who had already suffered a heart attack, and their coffee consumption was recorded afterwards, which introduces the possibility of recall bias: people who have had a cardiac event may remember or report their previous habits differently from healthy controls. Prospective cohorts, where intake is recorded before anyone becomes ill, do not have this problem, and the UK Biobank analysis discussed below is one.
Set against that, the genotype half of the analysis is immune to recall bias entirely, since genotype cannot be misremembered. That is the strength of a gene-by-environment design: half the exposure is measured perfectly even when the other half is not.
So the association ran in opposite directions depending on genotype. Coffee was associated with increased heart attack risk only among slow metabolisers, with no increase, and possibly a slight decrease, among fast metabolisers. The authors concluded that this implicated caffeine specifically, since the non-caffeine constituents of coffee are identical for both groups and only caffeine handling differs.
That is a mechanistically elegant result, and it offered a plausible explanation for why decades of research on coffee and heart disease produced such inconsistent findings: studies were pooling two populations with opposite responses and reporting the average.
The study that complicates it
A tidy story deserves a hard test, and it got one. Loftfield and colleagues analysed 498,134 UK Biobank participants[3] and constructed a caffeine-metabolism genetic score from variants in AHR, CYP1A2, CYP2A6 and POR, all of which influence caffeine handling. They then examined whether the association between coffee drinking and mortality differed across that score.
It did not. Coffee drinking was inversely associated with mortality across the range of the genetic score, including among people drinking 8 or more cups a day, and similar associations appeared for instant, ground and decaffeinated coffee.
The two results are not necessarily contradictory, and it is worth being careful about how they differ rather than declaring a winner. The outcomes are different, myocardial infarction versus all-cause mortality. The populations are different, Costa Rican versus British. The genetic instruments are different, a single variant versus a multi-gene score. Sample sizes differ by two orders of magnitude. It is entirely possible for genotype to modify a specific cardiac risk while being invisible against overall mortality, where many causes of death are pooled.
Everything the average conceals
There is a broader lesson in this disagreement that applies well beyond caffeine, and it is worth stating explicitly because it bears on how you should read every other article in this section.
It is one of the few genuinely useful things pharmacogenetics has taught the general public, even though the specific test it inspired is not yet worth buying.
When a study reports that coffee is associated with a 10% lower risk of something, that figure is an average across everyone in the study. If the population contains a subgroup for whom coffee is genuinely harmful and a larger subgroup for whom it is beneficial, the average will report a benefit and the harmed subgroup will be invisible. The Costa Rican study is a demonstration that this is not merely theoretical: within one population, the same exposure ran in opposite directions depending on a single common genetic variant.
This is the strongest available argument for treating your own experience as evidence. Population research describes the average of a mixture. You are one member of that mixture, and you have information about yourself that no cohort study has.
Why commercial genetic tests overreach
Direct-to-consumer genetic tests offering caffeine recommendations are now widely sold, and it is worth explaining why the evidence does not support them.
The underlying science is real and the product built on it is premature, which is a common pattern in consumer genomics.
They typically genotype one or two variants, most often CYP1A2 rs762551, and issue a recommendation. But caffeine response depends on metabolism and on receptor sensitivity, which are governed by different genes, and on smoking, medication, hormonal status and liver function, none of which a saliva sample knows about. The largest study to look for genotype-modified mortality effects, the UK Biobank analysis of 498,134 people[3], found none.
So a test can tell you which variant you carry, which is a real fact, and cannot reliably tell you what to do about it. Two weeks of paying attention to your own sleep and jitteriness is cheaper and more informative.
What the disagreement does establish is that genotype-based coffee advice is not currently supportable. The evidence is interesting and incomplete, and commercial genetic tests that tell you how much coffee to drink are running considerably ahead of it.
Everything else that changes your caffeine clearance
Genetics is one input among several, and some of the others are larger and easier to act on. Smoking substantially induces CYP1A2 and can roughly halve caffeine half-life, which is why smokers often drink more coffee and why people who quit smoking frequently find their usual coffee suddenly overwhelming. Oral contraceptives slow clearance considerably, sometimes doubling half-life. Pregnancy slows it dramatically, particularly in the third trimester, which is part of the rationale behind the guidance covered in our pregnancy article. Liver disease slows it. Some medications inhibit or induce the enzyme, including certain antibiotics and antidepressants.
What slow metabolism actually feels like
Since a test is not much use, it is worth describing the phenotype, because most people can place themselves reasonably well from experience.
Slow metabolisers typically report that a single afternoon coffee affects their sleep that night, that effects from one cup last well into the evening, that jitteriness or a racing heart appears at doses others find unremarkable, and that they feel caffeine strongly rather than subtly. Fast metabolisers typically report that coffee wears off quickly, sometimes within two or three hours, that they can drink it late without obvious consequence, and that they need more of it for the same effect.
Neither pattern is better. They are common variants of an ordinary enzyme, and the only practical consequence is that generic advice about how much coffee to drink and when will fit one group considerably better than the other.
Two cautions on self-diagnosis. Tolerance from habitual use mimics fast metabolism, since a daily drinker feels less from each cup regardless of genotype. And Drake and colleagues showed that people are unreliable judges of their own sleep under caffeine[4], so feeling that late coffee does not affect your sleep is weak evidence that it does not.
The more reliable signals are the ones that do not depend on self-assessment: how long jitteriness lasts, whether your heart rate is noticeably elevated hours later, and what a tracker says about your sleep on high-caffeine days against low-caffeine ones.
There is also adenosine receptor variation, which is separate from metabolism. Variants in ADORA2A, the gene for the receptor caffeine blocks, are associated with differences in caffeine-induced anxiety and sleep disruption independent of how quickly you clear the drug. So a person can be a fast metaboliser and still be highly sensitive, because sensitivity and clearance are governed by different genes.
How to work out your own answer
The practical conclusion is that you do not need a genetic test, because you already have better data. If caffeine keeps you awake for many hours, if a single cup produces noticeable jitteriness, or if the effects of an afternoon coffee are still obvious at bedtime, you are behaving like a slow metaboliser regardless of what any test says. If you can drink coffee at 8pm and sleep normally, you are probably fast, though Drake and colleagues showed that people are poor judges of their own sleep under caffeine[4], so a wearable or a two-week experiment beats intuition. Our sleep article covers this.
The other practical implication is more general: population averages in coffee research describe a mixture of people who respond very differently. When a study reports that coffee is associated with a 10% risk reduction, that number may conceal a benefit in one genetic group and a harm in another. That is worth remembering every time you read a coffee headline, including the ones in this section.
It is also a reason to be sceptical of confident advice about coffee that does not acknowledge variation, including advice that says everyone should drink more of it.
The summary
CYP1A2 handles most caffeine metabolism and its common variants divide people into fast and slow metabolisers, with half-lives differing severalfold. A Costa Rican case-control study found coffee associated with higher heart attack risk only among slow metabolisers, while a much larger UK Biobank study found no genotype difference in the mortality association. Smoking, oral contraceptives, pregnancy and liver function all shift clearance as much as genes do, and adenosine receptor variants affect sensitivity separately.
Taken together, that is a lot of moving parts for a single saliva test to summarise into a recommendation.
The broader point is the one worth keeping: when a study reports an average, it is describing a mixture of people who may not respond the same way, and you are one specific member of that mixture.
Genotype-directed coffee advice is not yet supportable on this evidence. Your own reliable observations about how caffeine affects you remain the most useful guide available.
That may change as larger gene-by-environment studies accumulate, and it has not changed yet.
Until it does, your own experience remains the better instrument.
It is also free, and it has been collecting data your whole adult life.
That is an unsatisfying answer for anyone hoping genetics would supply a number, and it is the accurate one.