When you want to quench your thirst, you probably don’t reach for a steaming cup of coffee or tea. But despite what you’ve heard, coffee and caffeinated tea are not dehydrating, experts say.

It’s true that caffeine is a mild diuretic, which means that it causes your kidneys to flush extra sodium and water from the body through urine. If you’re peeing frequently, and thus losing lots of liquid, it’s logical to think you could become dehydrated — but it actually doesn’t work that way, explains Dr. Daniel Vigil, an associate clinical professor of family medicine at the David Geffen School of Medicine at the University of California Los Angeles.

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

“When you drink a cup of coffee or you drink a glass of iced tea, you are necessarily taking in a volume of fluid along with that dose of [caffeine],” Vigil says. Even though caffeine is a mild diuretic, Vigil says, you won’t lose more fluid through urine than you take in by drinking a caffeinated beverage. Your body is able to absorb as much fluid as it needs and expel the rest, he says.

For that reason, your morning pick-me-up actually helps hydrate you, not the opposite. Vigil says that coffee and tea “can and should” count toward your daily eight-or-so cups of water per day.

And if you find yourself with headaches or other symptoms after your morning java, Vigil says dehydration likely is not the culprit. You may just be sensitive to caffeine — or dehydrated for reasons that have nothing to do with your coffee or tea habit.

Write to Jamie Ducharme at jamie.ducharme@time.com.