Knowing how much caffeine is in a cup of coffee can be really helpful when you’re trying to limit your caffeine intake. While being dependent on the stimulant isn’t exactly life-threatening, it can leave you sleepy, grumpy, and jittery. Some people with certain health conditions may find their doctors even suggesting cutting back. And since drinking coffee can become so habitual, it’s easy to go a little overboard without even noticing it.

To be able to monitor caffeine intake, you first have to get a general idea of much caffeine is in a cup of coffee.

According to the USDA, regular, brewed coffee contains about 95 milligrams of caffeine per 8-ounce cup. “This is based on average values of home-brewed and fast-food coffee,” Beth Witherspoon, M.P.H., R.D.N., registered dietitian consultant for Community Coffee Company, tells SELF.

A 2014 study that analyzed caffeine content from multiple sources, including two USDA databases, found that an 8-ounce cup of regular brewed coffee can range in caffeine content from about 75 to 165 milligrams. Flavored coffees tend to have less caffeine, with about 48 milligrams per 8-ounce cup. (Espresso, which you’re probably not drinking a full 8 ounces of at a time, can have as much as 500 milligrams of caffeine per 8-ounce serving.)

There are a lot of things that can influence exactly how much caffeine is in a cup of coffee.

“Caffeine content varies between types and species of coffee beans, and can depend on where the beans were grown, and how the coffee is roasted and then prepared,” Witherspoon says. “All of these factors contribute to the variation in caffeine content between cups of coffee.”

The Mayo Clinic explains that even the same type of coffee from the same coffee shop can vary in caffeine content from day to day. If the beans were ground differently, or an extra scoop was put into the coffee maker, the caffeine content can fluctuate.

Witherspoon adds that light roast coffee usually has more caffeine in it than dark roast. “When measured by volume, light roast beans are denser, weigh more, and thus contain more caffeine than dark roast beans (which lose more water in roasting and weigh less when measured by volume),” she explains.

While most people don’t need to account for every last bit of caffeine they take in daily, a close estimate can help those who are trying to cut back on the stimulant.

Drinking too much caffeine can cause headaches, restlessness, and anxiety in some people. For others, too much after a certain time in the afternoon can cause insomnia.

For the average healthy adult, experts recommend consuming a maximum of 400 milligrams of caffeine each day. That’s three to five 8-ounce cups, depending on specific caffeine content, Witherspoon says. “Individuals should adjust this moderate amount based on how it makes them feel,” she adds.

For example, if you have a hard time falling asleep at night, try cutting yourself off sometime between noon and 2 P.M. to avoid insomnia later on. Everyone has their own level of tolerance, though, so you may need to do some experimenting to find what works for you.

If you’re pregnant or have a heart condition, talk to your doctor about what caffeine limits are appropriate for you. There’s a lot of conflicting evidence about what’s safe during pregnancy, so until more conclusive evidence is available, experts recommend limiting intake to 200 milligrams per day.

You may also like: 10 Ways You're Sabotaging Your Sleep Without Realizing It