A $45-billion megamerger of H.J. Heinz and Kraft Foods is a big-money gamble in today’s changing marketplace, with young eaters increasingly going for more natural foods. (Brendan McDermid/Reuters)

The corporate kings of sugary ketchup and processed cheese, under assault by consumers’ growing love for fresher cuisine, are making a major gamble to revive their fortunes in the face of the changing American appetite.

H.J. Heinz and Kraft Foods Group, two of the most iconic names in the nation’s kitchens, said Wednesday they would merge through an estimated $45 billion deal to form one of the world’s biggest food empires.

The new company, Kraft Heinz, would be stuffed with long-lasting staples of the family meal, with Heinz’s ketchup joining Kraft’s Jell-O, Kool-Aid, Oscar Mayer, Velveeta and its namesake macaroni and cheese.

But sales of the packaged-food industry’s once-beloved, heavily processed cuisines have crumbled in recent years, as increasingly health-conscious American shoppers — and particularly younger eaters — flock to simpler, more natural fare. Kraft, which counts processed cheese as its biggest seller, saw profits plunge more than 60 percent last year, to $1 billion.

The marriage of Heinz with Kraft, orchestrated by legendary investor Warren Buffett and a team of Brazilian buyout kings, would produce a household-name powerhouse that its new leaders said will slash jobs and an estimated $1.5 billion a year in costs.

With that leanness, the new company is expected to invest in sprucing up its healthful image. Kraft has already pushed to remove artificial coloring from some of its cheeses, and last year it unveiled an Oscar Meyer meat-and-cheese-cube combo called the P3 Portable Protein Pack. But it could be a tough sell.

“If you were to ask, ‘What’s the core thing you associate with those two brands,’ ” said Hugh Tallents, a partner at management consultancy cg42, “healthy eating would not be in the top things anyone says.”

Don’t expect a healthier Kraft Heinz food giant to appear overnight. All artisanal foods aside, these companies will still likely count on a market for classic comfort foods.

“There is still a good part of America that fills their pantry with these products, to the tune of tens of billions of dollars a year,” said Bruce Cohen, a partner leading the retail private equity and strategy practice at consulting firm Kurt Salmon. “As much as my kids like organic crackers, they really still love ketchup.”

Though the push to simpler, healthier eating was long derided as a fad, analysts said the strengthening sales of fresh-food upstarts have forced packaged-food conglomerates to take notice.

Organic-food sales jumped 11 percent in 2013, to $35 billion, Organic Trade Association data show. Sales of high-protein wellness bars are growing at more than twice the speed of the overall food industry.

Some packaged-food giants have spent heavily with hopes of capturing the growing trend toward healthier cuisine. General Mills said in September it would pay $820 million to buy Annie’s, which makes organic and unrefined food.

Hershey, the chocolate titan, expanded into natural snacks in January by buying Krave Pure Foods, a maker of “healthy gourmet jerky.” Even Nestlé USA, maker of Baby Ruth and Butterfinger, said earlier this year it would remove artificial flavors and colors from more than 250 of its chocolate bars.

Blaming “changes in consumer preferences” for sliding sales of its meal and dessert brand, Kraft has been unable to shake its preservative-packed legacy. Earlier this month, health advocates slammed a nutrition seal added to Kraft Singles, the lunchbox-size slices of “Pasteurized Prepared Cheese Product.” Other bad headlines haven’t helped, including a recall this month of more than 6 million boxes of Kraft Macaroni & Cheese, some of which were found to have metal shards.

The megamerger was engineered by Buffett’s Berkshire Hathaway and 3G Capital Partners, a famed Brazilian private-equity giant. The two worked together in 2013 to buy Heinz for $23 billion, and will retain a 51 percent stake in the new firm.

The value of the merger was estimated at more than $45 billion, making it the year’s biggest corporate takeover, data from investment-bank platform Dealogic show. It will also create North America’s third-largest food and drink giant, topped only by PepsiCo and Nestlé. Excited investors on Wednesday sent Kraft shares soaring 35 percent.

“This is my kind of transaction,” Buffett said in a statement. “I’m excited by the opportunities for what this new combined organization will achieve.”

It’s unclear how Kraft’s offerings might change under the new label. The Brazilian firm has a reputation for gobbling up sagging consumer favorites, aggressively slashing costs and reshaping brands in hopes of garnering better business. Refreshing the century-old Kraft’s processed fare will likely be one of their first big moves, analysts said.

“Unless the combined company focuses on [product innovation],” said Neil Saunders, managing director of retail consulting firm Conlumino, “it will ultimately end up being larger but no more successful than the standalone companies are today.”

The merger of Heinz, which is popular overseas, with Kraft, which owns eight brands with yearly sales of $1 billion or more, could allow the new firm to combine forces on new investments and give the pairing a better chance at global growth. The company will have combined yearly revenues of about $28 billion and headquarters in the Pittsburgh and Chicago areas.

When Berkshire and 3G bought Heinz, the firm saw plants closed, jobs cut and budgets squeezed under a fierce cost-cutting plan. (A favorite phrase of Carlos Alberto Sicupira, one of the Brazilian billionaires who head 3G: “Costs are like fingernails: You have to cut them constantly.”)

Both companies’ boards unanimously approved the merger, but the deal will still need approval from Kraft’s shareholders and federal regulators before its scheduled closing later this year.

It’s unclear how antitrust regulators will size up the new global giant.

“Just getting bigger is not a violation of antitrust,” said Ben Gomes-Casseres, a professor at the Brandeis International Business School in Boston. “These two are not in the same market, besides being processed foods. . . . I don’t expect the price of ketchup to go up.”

But some market-watchers said the merger signaled that there could be more consolidation among makers of packaged foods, leaving fewer monolithic brands and shrinking the variety of prices and products on supermarket shelves.

“All these food-space mergers give [buyers] the illusion of choice. They’re thinking, ‘Oh gosh, look at all these brands,’ ” said Diana Moss, president of the American Antitrust Institute. “But what the consumer doesn’t see is the smaller and smaller number of manufacturers maintaining those brands.”

The takeover could also pave the way for even further expansion by 3G into America’s pantries. Leaders of the investment firm, which bought Burger King in 2010 and Canadian coffee-and-donut chain Tim Hortons last year, have reportedly eyed firms such as the Campbell Soup Co. and PepsiCo for takeover. Buffett told the Wall Street Journal in January, “These guys have global ambitions.”