Mani Subramanian from the University of Iowa and colleagues note that caffeine's popularity as a "pick-me-up" has led to it being added to more than 570 beverages and 150 food products, including gums and jelly beans.
It also comes in a pure powder form that consumers can use themselves to spike drinks and food.
In small amounts, most people can handle caffeine without a problem.
Subramanian's team, including Sujit K Mohanty and Sridhar Gopishetty and Chi Li Yu, wanted to develop a quick and easy way for consumers to determine whether the caffeine levels in their foods and drinks fall within a safe range.
They tested an enzyme called caffeine dehydrogenase and found that it could detect caffeine in a variety of drinks - with the exception of teas - within one minute.
Also, it was sensitive enough to pick up on caffeine's presence at concentrations as low as 1 to 5 parts per million, the maximum limit the US Food and Drug Administration (FDA) advises for nursing mothers.
The research was published in the Journal of Agricultural and Food Chemistry.
