Caffeine, sleep and anxiety
Why the afternoon coffee is still working at midnight, why caffeine arousal is almost impossible to tell apart from anxiety from the inside, and why the same dose does very different things to different people.
Wellbeing science
Caffeine does not give you energy. It blocks the receptors that adenosine uses to tell you how long you have been awake β so the tiredness is still accumulating underneath, it is simply not being reported. That is why the crash is not a metaphor. When the blocker clears, the accumulated message arrives all at once.
Two consequences follow from this rather mundane pharmacology, and between them they account for most of what people come here wondering about. The first is a matter of arithmetic: caffeine takes much longer to leave than most people assume, so the afternoon cup is still present at bedtime. The second is a matter of perception: what caffeine does to the body β faster heart, faster thoughts, tighter chest, more alert to threat β is very close to what anxiety does to the body, and from the inside they are almost impossible to tell apart.
Which means a great many people are drinking something that produces the symptom they are drinking it to cope with.
The arithmetic of the half-life
Caffeine's half-life in a healthy adult runs roughly three to six hours, with wide individual variation β Fredholm's review remains the standard source. Half-life means the time to clear half of it, so the tail is longer than the number suggests.
Take a five-hour half-life and a coffee at three in the afternoon. By eight in the evening, half is still circulating. By one in the morning, a quarter. That quarter is not nothing: it is enough to change what the first half of the night looks like.
The experiment people should know about is Drake's in 2013, which gave a dose equivalent to a strong coffee at bedtime, three hours before bed, and six hours before bed, and measured sleep objectively. All three timings disrupted sleep, including the six-hour one β and the participants, importantly, did not reliably notice that the six-hour dose had done anything.
Gardiner's 2023 meta-analysis pooled twenty-four studies and put numbers on it: caffeine reduced total sleep time by around forty-five minutes and sleep efficiency by about seven percent, increased the time taken to fall asleep, and shifted the night toward light sleep and away from deep sleep. Working backwards from their data, the authors suggested a standard coffee should be finished roughly nine hours before bed to avoid measurable loss of sleep time, and a strong pre-workout dose considerably earlier than that.
Nine hours is a startling figure the first time you see it. For an eleven o'clock bedtime it means the last coffee at two in the afternoon. We are not going to pretend most people will do that; the useful version is that the cut-off is much earlier than the folk rule of "nothing after dinner", and moving it earlier by two hours is a real intervention with a real effect size.
And a loop worth naming: worse sleep produces more tiredness, which produces more caffeine, which produces worse sleep. Most people arriving at four or five cups a day did not choose that number. It was arrived at one compensation at a time. The entry on sleep debt is the other half of that circle.
Why it is so easily mistaken for anxiety
The overlap is not vague. Caffeine at sufficient dose produces tachycardia, restlessness, gastrointestinal disturbance, tremor, sleeplessness and racing thought. That list is more or less the physical half of a panic response.
It is recognised formally. Caffeine-induced anxiety disorder is a named diagnosis in DSM-5, alongside caffeine intoxication and caffeine withdrawal. The category exists because clinicians kept seeing people whose anxiety resolved when the dose came down.
Two directions of error are common, and they are opposites:
- Treating caffeine arousal as evidence of a problem. The heart is racing, the thoughts are fast, the conclusion is something is wrong with me β and because the person is now monitoring their heart, the prediction machinery described in the entry on interoception amplifies what it finds. This is a very common route into a first panic attack.
- Treating anxiety as tiredness. The flat, foggy, unable-to-start feeling of a bad week gets read as needing more caffeine, which sharpens the arousal without touching the flatness.
Withdrawal muddies it further. Headache, irritability, low mood and difficulty concentrating peak a day or two after stopping and take up to a week to settle. Anyone cutting down should expect the first few days to feel like a strong argument for not cutting down.
Why there is no single right dose
This is the part that makes universal advice impossible, and it is well established.
Childs and colleagues found that variation in ADORA2A, the gene for the adenosine receptor caffeine acts on, predicted how much anxiety a given dose produced. Rogers and colleagues replicated and extended it: the same dose that made one genotype alert and comfortable made another jittery and anxious, and habitual heavy consumers had largely developed tolerance to the alerting effect while remaining vulnerable to the anxiogenic one. Clearance speed varies too, driven substantially by liver enzyme variation, which is why "it does not affect my sleep" can be literally true for the person next to you and false for you.
So the friend who has an espresso after dinner and sleeps fine is not lying and is not more relaxed than you. They are a different metabolism with a different receptor. Your evidence about yourself comes from your own week, not from theirs.
What it means for you
Run the two-week test. Keep the amount the same and move the last dose two hours earlier. Two weeks, because the first three days are withdrawal and are not data. Then look at how long you take to fall asleep and how the mornings feel. This tells you more than any general recommendation can.
If you are working on anxiety, change caffeine first. It is the cheapest variable in the system and it is upstream of the symptoms you are trying to read. It is difficult to tell whether a treatment is working while the dose is still moving.
Use it against the right target. Caffeine offsets the alertness cost of a short night; it does nothing for the accumulated debt underneath. For the afternoon slump, the better instrument is usually a short nap β and the combination, caffeine immediately before a brief nap, is a genuine finding rather than a trick, set out in the entry on napping.
And notice what it is standing in for. Someone whose day runs on caffeine from the morning and on something else in the evening is not managing a beverage. They are managing a mismatch between what the days demand and what the nights restore, and that mismatch is the thing worth looking at β tired but wired is where that usually ends up.
sources
- Β· Fredholm, B. B., BΓ€ttig, K., HolmΓ©n, J., Nehlig, A., Zvartau, E. E. (1999). Actions of caffeine in the brain with special reference to factors that contribute to its widespread use. Pharmacological Reviews.
- Β· Drake, C., Roehrs, T., Shambroom, J., Roth, T. (2013). Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine.
- Β· Gardiner, C., Weakley, J., Burke, L. M., et al. (2023). The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Medicine Reviews.
- Β· Childs, E., Hohoff, C., Deckert, J., Xu, K., Badner, J., de Wit, H. (2008). Association between ADORA2A and DRD2 polymorphisms and caffeine-induced anxiety. Neuropsychopharmacology.
- Β· Rogers, P. J., Hohoff, C., Heatherley, S. V., et al. (2010). Association of the anxiogenic and alerting effects of caffeine with ADORA2A and ADRA2A polymorphisms and habitual level of caffeine consumption. Neuropsychopharmacology.
- Β· American Psychiatric Association (2013). Diagnostic and Statistical Manual of Mental Disorders, Fifth Edition. American Psychiatric Publishing.