How healthy is your coffee, actually? A measurement.
TL;DR — Coffee Score is a free interactive measurement tool that estimates how your daily caffeine affects your sleep, your longevity bonus, and your overall pattern, based on three peer-reviewed studies (Gardiner 2024 SLEEP RCT, Poole 2017 BMJ umbrella review, Liu 2022 UK Biobank cohort). You enter five inputs in thirty seconds and see a 0–100 Coffee Score, five subscores (Dose, Timing, Sleep, Load, Balance), and an actionable plan for tomorrow. Coffee is the primary source for most users — but Coffee Score also counts tea, matcha, energy drinks, decaf, and cola toward your total.
Most people think their afternoon coffee is fine. The cup at three o'clock feels routine — same as the cup at noon, same as the cup at nine. By bedtime, the alertness has faded, the room is dark, sleep arrives without fanfare. The next morning carries no memory of caffeine's interference. Whatever happened underneath the sheets stayed there.
But a randomized controlled trial published in SLEEP in 2024 measured what actually happens, and the measurement does not match the feeling. Investigators gave twenty-three healthy adults either a placebo, 100 milligrams of caffeine, or 400 milligrams of caffeine — once at twelve hours before bed, once at eight, once at four. In-home polysomnography captured every minute of sleep that followed. The 100-milligram dose, even at four hours before bed, produced no significant disruption against placebo. The 400-milligram dose was a different story.
What 400 milligrams at three in the afternoon actually does to your midnight sleep

At four hours before bed, the 400-milligram dose cut perceived sleep quality by 34.02 percent. That number is specific because the trial was specific: dose isolated, timing isolated, sleep measured by sensors rather than memory. The investigators wrote that the result "supports recommendations to avoid substantial caffeine consumption for at least 6 hours pre-bedtime" — a sentence written in the cautious tone of medical guidance but anchored in numbers no editorial committee could soften.
Four hundred milligrams is roughly four filter coffees, two cold brews, or a couple of stronger drip cups. A latte, by contrast, sits closer to 75 milligrams. The trial's quiet implication is that the conversation about "afternoon coffee" has been pointed at the wrong variable for years. The question was never when. The question was how much, with when as the multiplier.
Sleep impact by dose and timing (Gardiner et al. 2024, SLEEP, N=23 healthy adults, in-home polysomnography):
| Dose | 4h before bed | 8h before bed | 12h before bed |
|---|---|---|---|
| 100 mg (≈ 1 latte or small espresso) | No significant effect | No significant effect | No significant effect |
| 400 mg (≈ 4 filter coffees or 2 cold brews) | −34.02% perceived sleep quality | Greater sleep fragmentation | Significant sleep delay + architecture alteration |
The table reads cleanly: at 100 mg, timing does not matter for healthy adults; at 400 mg, timing matters enormously and extends back further than most people realize.
Caffeine in common drinks (per the Coffee Score reference table, used in the tool's math):
| Drink | Caffeine per typical serving |
|---|---|
| Espresso (1 oz shot) | 64 mg |
| Filter coffee (8 oz) | 95 mg |
| Latte (8 oz) | 75 mg |
| Cappuccino (6 oz) | 75 mg |
| Americano (8 oz) | 75 mg |
| Flat white (8 oz) | 130 mg |
| Cold brew (8 oz) | 200 mg |
| Mocha (8 oz) | 95 mg |
| Decaf coffee (8 oz) | 5 mg |
| Green tea (8 oz) | 30 mg |
| Matcha (8 oz) | 70 mg |
| Black tea (8 oz) | 47 mg |
| Energy drink (8 oz) | 80 mg |
| Cola (12 oz) | 35 mg |
The three-cup sweet spot — and why the fourth cup matters less

Stack that finding on top of the larger picture. The 2017 BMJ umbrella review by Poole and colleagues pooled 201 observational studies and 17 trials and found a U-shaped curve: relative risk of all-cause mortality drops to 0.83 at three cups per day versus zero, then plateaus. The fourth cup is not harmful, but it is not additive — the benefit stops climbing. A 2022 UK Biobank cohort of 171,616 participants confirmed the sweet spot, this time at 1.5 to 3.5 cups per day, with a 29 to 31 percent lower all-cause mortality even among those who added a small amount of sugar.
The two findings, taken together, draw a tight envelope: a few cups is the right amount, and the timing of those cups decides whether the benefit survives the night.
Why your CYP1A2 genotype changes the math
Population averages flatten one detail the model can't see. Caffeine's half-life — the time your body takes to clear half a dose — averages five hours in healthy adults. But the CYP1A2 enzyme that does most of the clearing varies by genotype: fast metabolizers can clear a dose in as little as two hours; ultra-slow metabolizers can take eight or more. Smoking induces faster metabolism (cuts the half-life roughly in half); pregnancy slows it down; older adults clear caffeine more slowly than younger ones. Coffee Score builds these into the model where the inputs allow, and hedges where they don't. A saliva genotype test would tighten the result; the tool can't request one, so it shows the range its assumptions allow.
How Coffee Score puts these numbers on your body
Screen 1 collects nine pieces of information across five visual rows: what you drink, how many cups, when the first and last lands, who you are, and when you sleep. The math runs in the background — total milligrams, half-life decay to bedtime, dose-response curve lookup, body-weight normalization, distribution check. Screen 2 returns a single composite Coffee Score from 0 to 100 and five subscores: Dose (where your total sits versus the sweet spot), Timing (whether your first and last cups land in the safe zone), Sleep (residual caffeine at bedtime versus the 50-milligram threshold), Load (milligrams per kilogram of body weight), and Balance (whether the cups spread sensibly or cluster).
The shape on the screen is a bezier-shaped coffee blob with five organic swellings. Each subscore stretches one swelling out from the center. Even subscores produce a balanced silhouette; uneven ones produce a recognizably lopsided splatter that the user reads as their own pattern. A character badge above the blob — Late Sipper, Morning Optimizer, Green Zone, Early Riser — names the pattern in two words.
What to actually do tomorrow
The third screen shows the dashboard and a live simulator. A user moves the cups slider from 3 to 2 — say, by dropping the third cup or switching it to decaf — and the blob morphs in real time: Sleep climbs from 43 to 79 (a 36-point gain), the residual at bedtime drops from 107 milligrams to 71, the composite Coffee Score gains 12 points (from 70 to 82). The Dose subscore eases slightly (93 → 82) because 190 mg/day sits below the 200–300 mg sweet spot, but Sleep and Load improvements offset it. Another user cuts from four cups to three and watches the Load subscore lift, the Dose stay flat, and the life-years estimated range (a hedged number, never a single figure) widen toward the upper bound the cohort literature supports.
The intent of the whole tool is one decision: change one thing tomorrow. A cup pushed earlier. A weak cup substituted for a strong one. Sleep three minutes longer, or measure it.
"The most important finding is that even modest doses of caffeine consumed several hours before bedtime can have measurable effects on sleep architecture," Gardiner and colleagues wrote in their 2024 conclusion. The measurement is there for you. The decision is yours.
Reviewed by Planimora Research · Last reviewed: May 2026 against Gardiner et al. 2024 (SLEEP), Poole et al. 2017 (BMJ), and Liu et al. 2022 (Annals of Internal Medicine) data. Updated quarterly as new peer-reviewed evidence emerges. A measurement. Not medical advice.