Photo by: (Xavi Gomez/Cover/Getty Images)

If you’re feeling sleepy and want to wake yourself up — and have 20 minutes or so to spare before you need to be fully alert — there’s something you should try. It’s more effective than drinking a cup of coffee or taking a quick nap.

It’s drinking a cup of coffee and then taking a quick nap. This is called a coffee nap.

It might sound crazy: conventional wisdom is that caffeine interferes with sleep. But if you caffeinate immediately before napping and sleep for 20 minutes or less, you can exploit a quirk in the way both sleep and caffeine affect your brain to maximize alertness. Here’s the science behind the idea.

How a coffee nap works

To understand a coffee nap, you have to understand how caffeine affects you. After it’s absorbed through your small intestine and passes into your bloodstream, it crosses into your brain. There, it fits into receptors that are normally filled by a similarly shaped molecule called adenosine.

Adenosine is a byproduct of brain activity, and when it accumulates at high enough levels, it plugs into these receptors and makes you feel tired. But with the caffeine blocking the receptors, it’s unable to do so. As Stephen R. Braun writes in Buzz: The Science and Lore of Alcohol and Caffeine, it’s like “putting a block of wood under one of the brain’s primary brake pedals.”

Now, caffeine doesn’t block every single adenosine receptor — it competes with adenosine for these spots, filling some, but not others.

But here’s the trick of the coffee nap: sleeping naturally clears adenosine from the brain. If you nap for longer than 15 or 20 minutes, your brain is more likely to enter deeper stages of sleep that take some time to recover from. But shorter naps generally don’t lead to this so-called “sleep inertia” — and it takes around 20 minutes for the caffeine to get through your gastrointestinal tract and bloodstream anyway.

So if you nap for those 20 minutes, you’ll reduce your levels of adenosine just in time for the caffeine to kick in. The caffeine will have less adenosine to compete with, and will thereby be even more effective in making you alert.

Experiments show coffee naps are better than coffee or naps

Scientists haven’t directly observed this going on in the brain after a coffee nap — it’s all based on their knowledge of how caffeine, adenosine, and sleep each affect the brain independently.

But they have directly observed the effects of coffee naps, and experiments have shown they’re more effective than coffee or naps alone in maximizing alertness.

In a few different studies, researchers at Loughborough University in the UK found that when tired participants took a 15-minute coffee nap, they went on to commit fewer errors in a driving simulator than when they were given only coffee, or only took a nap (or were given a decaf placebo). This was true even if they had trouble falling asleep, and just laid in bed half-asleep during the 15 minutes.

Meanwhile, a Japanese study found that people who took a caffeine nap before taking a series of memory tests performed significantly better on them compared with people who solely took a nap, or took a nap and then washed their faces or had a bright light shone in their eyes. Theyalso subjectively rated themselves as less tired.

Interestingly, there’s even some evidence that caffeine naps can help people go for relatively long periods without proper sleep. As part of one study, 24 young men went without proper sleep for a 24-hour period, taking only short naps. Twelve of them, who were given just a placebo, performed markedly worse on a series of cognition tests, compared with their baseline scores. Twelve others, who had caffeine before their naps, managed scores roughly the same as their baselines for the entire day.

How to take a coffee nap

Taking a coffee nap is pretty straightforward. First, drink coffee. Theoretically, you could drink another caffeinated beverage, but tea and soda generally have much less caffeine than coffee, and energy drinks are disgusting. Here’s a good database of the amount of caffeine in many types of drinks.

You need to drink it quickly, to give yourself a decently long window of time to sleep as it’s going through your gastrointestinal tract and entering your bloodstream. If it’s tough for you to drink a lot of hot coffee quickly, good options might be iced coffee or espresso.

Right after you’re finished, immediately try to go to sleep. Don’t worry if it doesn’t come easily — just reaching a tranquil half-asleep stage can be helpful.

Finally, make sure to wake up within 20 minutes, so you don’t enter the deeper stages of sleep and you’re awake when the caffeine is just starting to hit your brain.

Voilà: the perfect coffee nap.