The deal has been described by Heinz as "historic", and marks the biggest deal to date in the food industry.
Buffett, the chairman of Berkshire Hathaway Fund, was backed by investment firm 3G Capital.
The takeover has been approved by the Heinz board and will now need to be approved by shareholders.
William Johnson, chairman, president and chief executive of Heinz, said: "The Heinz brand is one of the most respected brands in the global food industry and this historic transaction provides tremendous value to Heinz shareholders.
"We look forward to partnering with Berkshire Hathaway and 3G Capital, both greatly respected investors, in what be an exciting new chapter in the history of Heinz."
Berkshire Hathaway and backers 3G Capital – the company which purchased Burger King in 2010 – have pledged to keep the Heinz headquarters in Pittsburgh.
In the UK and Ireland, Heinz employs around 2,500 people across its food factories and at its UK headquarters in Middlesex.Follow @johnreynolds10