Well Within

Caffeine and Sleep

By the Well Within Editorial Team · Updated November 16, 2026

Morning coffee beside oatmeal and sparkling water with lemon

Caffeine can make it harder to fall asleep and can leave sleep lighter, especially when you have it later in the day. The FDA says 400 milligrams a day is an amount not generally associated with dangerous, negative effects for healthy adults, but that's a safety ceiling, not a sleep target. For better nights, many people find the timing of their last cup matters as much as the total.

Caffeine is one of the most common reasons people feel wired at bedtime without realizing why. This guide, part of our Sleep section, explains the FDA guidance, how to think about timing, and where caffeine shows up when you aren't expecting it.

What the FDA says about caffeine

The FDA's guidance is that, for healthy adults, 400 milligrams of caffeine a day is an amount not generally associated with dangerous, negative effects. It's helpful to read that sentence carefully:

  • It's about safety, not sleep. Staying under 400 milligrams doesn't mean caffeine won't affect your sleep. Even a modest amount late in the day can keep some people up.
  • It's for healthy adults. It doesn't describe what's right for everyone.
  • People vary in sensitivity. Some people feel jittery or anxious after one cup. Others drink coffee after dinner and sleep fine. Your body's response is the best guide.
  • Some people should check with a doctor. That includes people who are pregnant, trying to become pregnant or nursing, and people taking certain medications or managing health conditions. Caffeine can interact with some medications, so your doctor or pharmacist is the right person to ask.

It's also wise to steer clear of very concentrated caffeine powders and liquids, where a small measuring mistake can mean far too much. Ordinary drinks and foods are easier to keep track of.

How caffeine can affect sleep

Caffeine is a stimulant. In plain terms, it helps you feel more alert by pushing back on the natural sleepy feeling that builds through the day. That's why it's so useful in the morning, and why it can get in the way at night.

Caffeine also hangs around. Your body clears it gradually over several hours, and the pace varies from person to person. So a mid-afternoon latte may still be working when you're trying to wind down.

Signs caffeine might be affecting your sleep:

  • Feeling tired but wired at bedtime
  • Taking longer to fall asleep on days you had a late coffee or soda
  • Waking more often in the night
  • Needing more caffeine in the morning to shake off grogginess, which keeps the cycle going

Timing your last cup

There's no single cutoff that works for everyone. A common rule of thumb is to have your last caffeinated drink by early afternoon, then adjust based on how you sleep.

Here's a simple experiment:

  1. Note when you usually have your last caffeine for a few days.
  2. Move it earlier by an hour or two.
  3. Keep the move for a week and jot down how quickly you fall asleep and how you feel in the morning.
  4. Adjust again if you notice a difference, or if you don't.

If you rely on caffeine to get through an afternoon slump, a short walk, a glass of water, daylight or a quick stretch are worth trying first. A brief, early nap is another option for some people; our guide to naps covers how long and when.

Where caffeine hides

Coffee gets most of the attention, but caffeine shows up in plenty of other places. Amounts vary a lot between brands, brewing methods and serving sizes, so check the label or the company's information when you can.

SourceGood to know
Brewed coffee and espresso drinksLarge café sizes and extra shots can add up quickly
Cold brewOften strong; check the serving size
Black, green and some herbal-blend teasTea has caffeine too; many herbal teas don't, but blends vary
SodasMany colas and some other sodas contain caffeine
Energy drinks and shotsCan be high in caffeine; read the label
Chocolate and cocoaContain some caffeine, more in darker chocolate
Pre-workout and "energy" productsOften contain caffeine, sometimes from several sources
Some pain relievers and other medicinesAsk your pharmacist if you're unsure
Decaf coffee and teaUsually a small amount, not zero

Labels can also list caffeine under other names, such as guarana or green tea extract. If you're unsure what's in something, your pharmacist can help.

Be wary of drinks or powders that promise all-day energy, focus or "fat burning" with big claims. Our guide to health scam red flags explains the warning phrases to watch for.

Rethinking your morning caffeine

A good breakfast can make the morning feel less dependent on caffeine. Pairing your coffee or tea with food that includes some protein and fiber helps many people feel steadier through the morning. Our guide to healthy breakfast ideas has quick and grab-and-go options.

Example: Taylor's afternoon soda

Example: Taylor, 36, drank two coffees in the morning and a cola around 4 p.m. most days. They didn't feel jittery, so they hadn't connected it to lying awake until midnight. They swapped the afternoon cola for sparkling water with lemon and took a ten-minute walk instead. After about a week, they noticed falling asleep felt a bit easier, though some nights were still restless. Taylor kept the morning coffees and decided the afternoon swap was worth keeping.

Cutting back gently

If you decide to drink less caffeine, go gradually. Stopping suddenly can leave some people with headaches, tiredness or irritability for a few days. Try:

  • Swapping one cup for half-caf or decaf
  • Choosing a smaller size
  • Replacing the afternoon drink with water, herbal tea or a walk

Caffeine and the rest of your sleep habits

Caffeine is one piece of the puzzle. Late-night screen time can also keep you alert; our guide to screens and sleep has ideas for a device curfew. And a dark, quiet, cool bedroom makes it easier to settle once the caffeine wears off; see our guide to your sleep environment.

When to ask a professional

Talk with your doctor if you feel you need a lot of caffeine just to function, if caffeine makes your heart race or leaves you anxious, or if you're pregnant, nursing or taking medications. And if you're tired all the time even with enough hours in bed, that's worth a conversation too.

Something to try today

Write down every caffeinated drink or food you have today, with the time. Tonight, look at the list and circle the last one. Tomorrow, move that one earlier or swap it for something caffeine-free, and see how your evening feels.

This guide is general education, not medical advice. Talk with your doctor or pharmacist about caffeine and your health.

Partner offer · paid placement

Want a structured wellness program?

Some people like the structure of a paid program. This button opens a third-party health or wellness program from one of our advertising partners. Its claims are its own, not ours, and haven't been evaluated by us or the FDA. Talk to your doctor before starting any program, diet or supplement, and weigh any offer against our health red flags checklist.

See the partner program →

We may be paid when you click. The program shown can change. Read its terms before you buy anything. How this works

Frequently asked questions

How late can I drink coffee and still sleep?

It depends on the person. Caffeine can stay in your system for hours, so many people find it helps to have their last caffeinated drink by early afternoon. Try moving yours earlier and see how your nights feel.

Is decaf completely caffeine-free?

Not always. Decaf coffee and tea usually contain a small amount of caffeine. For most people that's minor, but if you're very sensitive or your doctor has asked you to limit caffeine, it's worth knowing.

Can caffeine affect my sleep even if I fall asleep fine?

Some people fall asleep without trouble but still notice lighter or more broken sleep after late caffeine. If you wake up unrefreshed, an experiment with earlier or less caffeine is an easy thing to try.

See a partner programPartner offer
Partner offer · paid placement

Want a structured wellness program?

If you'd like more structure than articles can give, you can look at a third-party wellness program from one of our partners. Its claims are its own; check with your doctor first. No pressure: our free guides aren't going anywhere.

See the partner program →

We may be paid when you click. How this works