Stay Updated on Developing Stories

When to stop drinking caffeine to get a good night's sleep

(CNN) Many of us start our days the same way: with a cup of coffee or tea. Caffeine is as much a part of our routine as brushing our teeth or getting dressed for the day.

Maybe your habit extends to a cup of coffee in the afternoon, or you have a soda with your dinner.

And maybe as a result, you laid in bed awake later thinking of where you went wrong instead of getting needed sleep.

Rob M. van Dam, a researcher in epidemiology and nutrition from the National University of Singapore, explains when to wisely consume caffeine, what qualifies as too much and what to know about why it affects each of us differently.

This interview has been condensed and edited for clarity.

CNN: How do we know when it's time to stop drinking coffee during the day so we can still get a good night's sleep?

Rob van Dam: That sounds like a simple question, but unfortunately there's not one answer to it. And that's because different people react very differently to caffeine.

If you're getting tremors, feeling suddenly nervous, or your heart rate is changing, it could well be that you're drinking too much caffeine. And similarly, it can interfere with a good night's sleep.

Sign up for CNN's SLEEP, BUT BETTER newsletter

You may want to say, "Well, let's try to cut down caffeine and not drink it after a certain time in the afternoon and see if that improves my sleeping habits." So it's really something every individual has to experiment with for themselves -- how much caffeine they drink and when they drink it.

CNN: What factors affect how we react to caffeine?

Van Dam: Your lifestyle makes a difference. For example, people who smoke metabolize caffeine in the liver about twice as fast. If you're a smoker, likely you can drink caffeine up to a later time and still be OK in terms of sleeping.

But there are other factors, like if you use oral contraceptives as a woman, it takes twice as long to metabolize caffeine. It may be that you were able to drink caffeine in the evening and still sleep well, and then you start using oral contraceptives and you may see that you can't sleep as well anymore.

Genetics also plays a role, since some people have variants in their genetic code that affects enzymes in the liver that metabolize and get rid of the caffeine. This can make you metabolize it slower or faster, too.

CNN: How much caffeine is too much?

Van Dam: In general, it's recommended by associations like the U.S. Food & Drug Administration to keep caffeine at 400 milligrams per day or less. If you look at a normal 8-ounce cup of coffee, that has about 100 milligrams of caffeine, so that would be up to four cups of coffee per day.

Another recommendation is to keep it to no more than 200 milligrams per sitting. Even though you may drink four cups a day, you don't want to drink four cups in one go -- that will be too much for the body to metabolize, for most people at least.

CNN: Is caffeine for everyone?

Van Dam: Caffeine does truly pick you up a little bit and make you even more alert. So particularly for people with routine tasks, it can be beneficial. For example, if you must drive a lot at nighttime, or if you're in the military and you're on duty to monitor, but nothing is really happening for hours on end.

But not everybody will need it. You may have enough energy or get good enough sleep that you can go through the day without any caffeine.

And there's no reason to drink it if you don't want to. Because even if you like the taste of coffee, you can always drink decaffeinated coffee, and there's nothing wrong with that either.

CNN: Is caffeine safe?

Van Dam: Recently, people have been very concerned about caffeine in relation to cancer risk, cardiovascular risk or other health outcomes. And the research on that has actually been very reassuring. By now, coffee is probably one of the most studied beverages.

So, if you're enjoying coffee, you're enjoying caffeine, and you can consume it in moderation and you don't have any detrimental effects -- you don't really have to worry too much about the health effects of coffee or caffeine.

Outbrain