Surging prices for food staples from coffee to meat to vegetables are driving up the cost of groceries in the U.S., pinching consumers and companies that are still grappling with a sluggish economic recovery.

Federal forecasters estimate retail food prices will rise as much as 3.5% this year, the biggest annual increase in three years, as drought in parts of the U.S. and other producing regions drives up prices for many agricultural goods. The Bureau of Labor Statistics on Tuesday reported that food prices gained 0.4%...