Uh, oh—it’s 7 p.m., and you have the sudden urge to drink a hearty cup of coffee. (It’s just one of the problems all coffee lovers understand.) But don’t even think about opting for a dose of caffeine so late in the evening. Caffeine can stay in your bloodstream for up to 24 hours, which could keep you tossing and turning at night. Still, if you think sipping a cup of decaf will let you snooze without a problem, you might want to think again.

Most people assume that decaf coffee is 100 percent caffeine-free. But in reality, USDA regulations require decaffeinated coffee to be just 97 percent caffeine-free, so there is a little bit of caffeine in decaf coffee. While a 3 percent dose of caffeine may seem relatively small, it might be enough to keep you wide-awake until the wee hours of the morning. On the other hand, if you’re looking for a serious pick-me-up, these are the best sources of caffeine.

But why that little sliver of caffeine in decaf coffee? Turns out, the decaffeination process does remove most of the caffeine out of coffee beans—just not all of it. And some decaf brews have more caffeine than others. Generally speaking, Robusta beans will have more caffeine left after the decaffeination process than Arabica beans, according to Paul Toscano, chief marketing officer of Joyride Coffee.

The process itself can also determine how much caffeine is in your favorite decaf blend. The longer the coffee brews, the more caffeinated it is; in other words, decaf drinkers should opt for a blend that was brewed quickly. And Toscano recommends choosing coffee that was processed using the Swiss Water method, which can remove 99 percent of the caffeine from the beans.

“You can really taste the difference. It’s more expensive, but it is more ecologically friendly because you’re not using chemicals,” he told Business Insider. Beware, though, that the process might slightly alter its taste—which not all coffee drinkers love.

But how much is that, really? We spoke to experts at Partners Coffee, a roaster and brewing school based in Brooklyn to find out. Jonathan Withers, Director of Roasting, further explained the difference between a caffeinated and decaffeinated cup to us. “In a 12 oz cup of specialty coffee, there is typically between 150 and 300 mg of caffeine. In a 12 oz cup of specialty decaffeinated coffee, there’s typically between 5 and 15 mg of caffeine,” he said.

The biggest factor that determines your decaf choice, however, is your overall tolerance for caffeine. If you show any of these signs you drink too much coffee, you probably don’t need to worry about getting an energy kick from decaf coffee. On the flip side, those who don’t usually drink coffee might be wide awake for hours.

Bottom line? The next time you’re in the mood for a piping hot drink at night, you might be better off playing it safe with green tea, instead. And if you’re thinking about quitting cold turkey, this is what happens to your body when you quit drinking caffeine.

This article originally appeared on Reader’s Digest.