Caffeine Impact On Sleep Calculator

Quick answer

Caffeine has a half-life of about 5 hours, so half of a coffee is still in your body 5 hours later. A 111 mg coffee at 3:00 PM still leaves about 37 mg at an 11:00 PM bedtime. For most people, stopping caffeine at least 6 hours before bed protects sleep.

Updated October 11, 2026By Shakeel Muzaffar
Try
Sleep habits
Drink times are counted back from this bedtime.
Half-life varies a lot between people.
Pick None above if you had only one drink.
Caffeine left at bedtime
—
Total caffeine—
Last caffeine before bed—
Latest caffeine for this bedtime—
Share still active—

Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.

Saved results (0)

How To Use The Caffeine Impact On Sleep Calculator

  1. Enter your bedtime. Night-shift bedtimes in the morning work too; drink times are counted back from bedtime.
  2. Pick how fast you clear caffeine. Leave it on typical unless you smoke, take the combined birth control pill or are in late pregnancy.
  3. Add your first and last caffeine of the day. Choose the closest drink and the time you finished it. Pick None if you had only one.
ResultWhat it means
Caffeine left at bedtimeEstimated milligrams still active when you go to bed
Total caffeineAll the caffeine you entered for the day
Last caffeine before bedHours between your last drink and bedtime
Latest caffeine for this bedtimeYour bedtime minus 6 hours
Share still activeCaffeine left at bedtime as a share of the total

What Is Caffeine Half-Life?

Caffeine half-life is the time your body takes to clear half of the caffeine you drank. With a half-life of 5 hours, a 111 mg coffee drops to about 56 mg after 5 hours, 28 mg after 10 hours and 14 mg after 15 hours.

Caffeine keeps you alert by blocking adenosine, the chemical that builds up while you are awake and makes you sleepy. While enough caffeine is still active, it can delay sleep and make it lighter, even if you do not feel wired.

Half-life varies a lot from person to person. Smoking speeds clearance up, while the combined birth control pill roughly doubles the half-life and late pregnancy extends it further.

How Does The Caffeine Calculator Work?

The calculator applies the half-life decay to each drink and adds up what is left at bedtime.

Formula: Caffeine left = Dose x 0.5^(Hours before bed / Half-life); Latest caffeine = Bedtime - 6 hours
  1. Coffee at 8:00 AM, bed at 11:00 PM: 15 hours, or 3 half-lives. 111 x 0.5^3 = 14 mg.
  2. Coffee at 3:00 PM: 8 hours, or 1.6 half-lives. 111 x 0.5^1.6 = 37 mg.
  3. Total left at bedtime: 14 + 37 = about 50 mg, 23% of the 222 mg you drank.
  4. Latest caffeine for an 11:00 PM bedtime: 5:00 PM.

Worked Example: An 8 PM Energy Drink

StepValue
Morning coffee111 mg at 8:00 AM
Energy drink80 mg at 8:00 PM
Bedtime11:00 PM
Left from the coffee14 mg
Left from the energy drink53 mg
Caffeine left at bedtime67 mg

The total for the day is modest, but the energy drink lands only 3 hours before bed, so two thirds of it is still active. Moving it to 4:00 PM would cut what is left by more than half.

How Much Caffeine Is In Common Drinks?

DrinkServingCaffeine
Brewed coffee8 oz (227 ml)111 mg
Instant coffee8 oz (227 ml)45 mg
Tea, medium strength8 oz (227 ml)42 mg
Cola12 oz (330 ml)35 mg
Energy drink8.4 oz (240 ml)80 mg

Real amounts vary with brand, bean and brewing time. Coffee-shop sizes are often 12 to 20 oz, so one cup can be two or more servings. Check the label for energy drinks and pre-workout products, which can contain much more.

Factors That Change How Caffeine Affects Your Sleep

Metabolism

Liver enzymes clear caffeine at different speeds in different people, partly because of genes. Smokers clear it faster.

Medicines And Hormones

The combined pill and some medicines slow clearance. Ask a pharmacist if you are unsure about yours.

Pregnancy

Caffeine is cleared much more slowly in late pregnancy, so the same coffee lasts far longer.

Habit

Regular drinkers feel less of a buzz, but caffeine can still disturb sleep measured in a lab.

6-Hour vs 10-Hour Caffeine Cut-Off: Which Do You Need?

A 2013 sleep study gave people 400 mg of caffeine at bedtime, 3 hours before or 6 hours before bed. All three disturbed sleep, and even the dose taken 6 hours before bed reduced sleep by more than 1 hour on an in-home monitor.

BedtimeLatest caffeine (6 h)Safer for slow metabolizers (10 h)
10:00 PM4:00 PM12:00 PM
11:00 PM5:00 PM1:00 PM
12:00 AM6:00 PM2:00 PM

The 6-hour rule is a minimum. Larger doses and slower metabolism need an earlier cut-off. The 10-3-2-1-0 sleep rule uses an even stricter 10 hours.

Who Should Use A Caffeine And Sleep Calculator?

  • Afternoon coffee drinkers who want to know whether it reaches bedtime.
  • Shift workers timing caffeine around daytime sleep.
  • People with trouble falling asleep; if it happens most nights, check the pattern with the insomnia severity calculator.
  • Pregnant people and pill users, whose caffeine lasts much longer.

Common Mistakes With Caffeine And Sleep

Forgetting Hidden Caffeine

Tea, cola, chocolate, pre-workout drinks and some painkillers all add up.

Counting Cups, Not Size

A large coffee-shop coffee can hold two or three standard servings.

Judging By Feel

Not feeling alert does not mean caffeine is not affecting your sleep.

Using Caffeine To Cover Short Sleep

Late caffeine shortens the next night, which drives more caffeine the next day. Good evening habits from sleep hygiene 101 help break the cycle.

Accuracy And Limitations

The half-life maths is standard, but your real half-life and drink content are unknown, so treat the result as an estimate.

What It Estimates Well

  • How timing changes caffeine left at bedtime
  • The effect of slower or faster clearance
  • A cut-off time for your bedtime

What It Does Not Account For

  • Your exact half-life or genes
  • Absorption time and food
  • More than two drinks or exact brand content

To see whether cutting caffeine helps, compare your nights before and after with the sleep duration calculator.

How We Calculate Caffeine Left At Bedtime

Method
Exponential decay, dose x 0.5^(hours / half-life), summed over drinks
Half-life
5 h typical; 3.5 h for smokers; 10 h for pill users and late pregnancy
Cut-off
At least 6 hours before bed (Drake et al. 2013)
Daily limit
400 mg a day for most adults (FDA)

Caffeine And Sleep Calculator FAQs

How long before bed should I stop caffeine?

Stop at least 6 hours before bed. A sleep study found that caffeine taken 6 hours before bed still cut sleep by more than 1 hour.

What is the half-life of caffeine?

For many adults it is about 5 hours, but it varies widely. Smokers clear caffeine faster, and pill users and pregnant people more slowly.

How much caffeine is left after 8 hours?

With a 5-hour half-life, about a third remains after 8 hours. A 111 mg coffee leaves about 37 mg.

Is a 3 PM coffee too late?

For an 11 PM bedtime, a 3 PM coffee is 8 hours before bed, which meets the 6-hour minimum. Slow metabolizers may need to stop earlier.

How much caffeine is too much in a day?

The FDA cites 400 mg a day, about two to three 12 oz cups of coffee, as an amount not generally linked to negative effects for most adults.

Does decaf coffee affect sleep?

Decaf still contains a small amount of caffeine, usually far less than regular coffee, so it rarely matters for sleep.

Why can I sleep after coffee but still feel tired?

Caffeine can make sleep lighter and shorter even when you fall asleep easily, so you may wake less refreshed.

Does caffeine affect deep sleep?

Caffeine in the evening tends to reduce deep sleep and make sleep more broken, which is one reason late coffee leaves you tired.

Sources

Related Calculators

For bedtimes and wake-up times in both directions, use the main sleep calculator. Explore every sleep timing, sleep need and sleep health tool in one place.

All sleep tools

This calculator estimates caffeine levels from average values for general education. It is not medical advice. Ask a doctor or pharmacist about caffeine in pregnancy, with heart conditions or with your medicines. Spotted an error? Let us know.