Caffeine doesn't actually dehydrate you. Since 98 percent of caffeine is consumed in beverages, according to the FDA, you're also probably hydrating at the same time you take it in. So although caffeine is a diuretic, it's unlikely to truly dehydrate you. Still, that doesn't mean you should drink caffeinated beverages alone exclusively. Enjoy them in moderation, and don't forget that water is still the gold standard for hydration. (Learn more about this, plus 7 other myths about hydration.)
Caffeine sources aren't just limited to beverages. Chocolate is also a major source, and caffeine can also be added to almost any food or substance—which is why you'll also find caffeine in some medications, like Midol. If you have a heart condition or hypertension, check with your doctor before taking any pain relievers with caffeine.