WASHINGTON — Scorching heat and the worst drought in nearly a half-century are threatening to send food prices up, spooking consumers and leading to worries about global food costs.

On Wednesday, the government said it expected the record-breaking weather to drive up the price for groceries next year, including milk, beef, chicken and pork. The drought is now affecting 88 percent of the corn crop, a staple of processed foods and animal feed as well as the nation’s leading farm export.

The government’s forecast, based on a consumer price index for food, estimated that prices would rise 4 to 5 percent for beef next year with slightly lower increases for pork, eggs and dairy products.

The drought comes along with heat. So far, 2012 is the hottest year ever recorded in the United States, according to the National Oceanic and Atmospheric Administration, whose records date to 1895. That has sapped the production of corn, soybeans and other crops, afflicting poultry and livestock in turn.