I usually drank a lot of coffee, around 4 large coffees a day, two in the morning and two in the afternoon. But recently I stopped drinking coffee after 12 PM and in this post, I will explain why and try to convince you to do the same.

I work as a Software Engineer and I spend the whole day sitting in front of the computer. And like most developers, I drink a lot of coffee. For me was not even related to the need to drink coffee to be alert, I think it just became my routine and I needed to have something to drink.

Maybe it was when I just committed a code and was waiting for the pipeline, or because I was in the trial and error mode trying to figure out a bug. But I always had a coffee. Even at the end of the day (like 6 PM) I was still drinking coffee.

But after reading the book Why We Sleep - Unlocking the power of sleep and dreams I became aware of the effects of caffeine on sleep and I decided to stop drinking coffee after 12 PM.

According to Mathew Walker, caffeine half-life is between 5 and 7 hours, which means that after 5 to 7 hours, you still have 50% of the caffeine in your body. Or in other words, between 10 and 14 hours after you drink your coffee, you still have caffeine in it.

So if you drink your last coffee at around 6 PM, at 11 PM (maybe the time you go to sleep), you still have around half of the caffeine in your system. Of course, this depends on each person, some people are more caffeine tolerant and also clean it from the bloodstream faster.

Ok, but what does caffeine do to the body? Let’s see below how caffeine works.

Caffeine works by blocking (occupying) the receptors of sleep pressure (adenosine). Sleep pressure builds up as you are awake, the more time you are awake, the more sleep pressure you have in your system. By blocking the receptors, you don’t feel the pressure so your body has more resistance to sleep.

Or in the words of the author, “Once caffeine occupies these receptors, however, it does not stimulate them like adenosine, making you sleepy. Rather, caffeine blocks and effectively inactivates the receptors, acting as a masking agent. It’s the equivalent of sticking your fingers in your ears to shut out a sound.”

As caffeine is hijacking and occupying these receptors, caffeine blocks the sleepiness signal normally communicated to the brain by adenosine. Tricking you into feeling alert and awake, despite the high levels of adenosine that would otherwise seduce you into sleep.

Ok, so we understand how it works, but what is the effect? As the author tells, “Sleep will not come easily or be smooth throughout the night as your brain continues its battle against the opposing force of caffeine. Most people do not realize how long it takes to overcome a single dose of caffeine, and therefore fail to make the link between the bad night of sleep we wake from in the morning and the cup of coffee we had ten hours earlier with dinner.”

So, not having caffeine in our body (or having less possible) will help us sleep faster and better.

The bad news is that caffeine is not only present in coffee, it is also present in certain teas, many energy drinks, foods such as dark chocolate and ice cream, as well as drugs such as weight-loss pills and pain relievers.

So watch out for other sources of caffeine that are making your sleep worse.

If you want to hear about caffeine in the author’s words, you can listen to these two episodes (#10: Sleep and Caffeine – Part 1 and #11: Sleep and Caffeine – Part 2) from the author’s podcast (The Matt Walker Podcast)

I hope this will help you sleep faster and better.

Happy sleeping!


Special thanks to my wonderful wife May for making the beautiful post-it note that I have in front of my “home office” which help me to forget about it.