Two of the best-known American food brands may soon unite in a deal that could reshape the industry — thanks in part to the efforts of a Brazilian investment firm with a penchant for deals.

The investment firm 3G Capital — through the ketchup maker H. J. Heinz, which it owns with the billionaire Warren E. Buffett — is in talks to buy Kraft Foods, a person briefed on the matter said on Tuesday.

As of Tuesday’s market close, Kraft had a market value of about $36.5 billion, meaning that a final price could exceed $40 billion.

From its base in Brazil, 3G has become a powerhouse in the world of food brands. The firm, which counts the billionaire financier Jorge Paulo Lemann among its owners, has made daring moves for companies like Burger King, which it bought in 2010.