The German team said Westermann had fractured a bone in his foot at the end of Saturday's 3-0 win over Hungary.
The Schalke 04 player, who has won 19 caps, is a defender but could have provided cover in midfield following the injuries to Michael Ballack and Christian Traesch -- who have both been ruled out.
"Naturally I am devastated because it was my big goal to take part in the World Cup," said Westermann. "I felt fully fit but now the only thing left for me to do is to wish the team all the best at the tournament."
Germany coach Joachim Loew, who now has only 24 fit players left from his preliminary 27-man squad, said Westermann's versatility would have been needed in South Africa,
Loew will have to cut his squad to 23 players by June 1 before the team travels to South Africa on June 6 for the tournament starting five days later.
"Heiko would have played a very important role at the world Cup for our team. That is because of his multi-faceted play. In training he was in superb physical condition," Loew said.
The coach, who had picked six strikers for his preliminary squad and had said all of them would travel to South Africa, could now be forced to sacrifice one of them to allow his team to have more options in midfield.
Loew could opt to leave left back Marcell Jansen behind, battling to regain fitness after an ankle injury late in the season.
Germany have been drawn in Group D alongside Serbia, Australia and Ghana.
(Writing by Karolos Grohmann, editing by Kevin Fylan and Pritha Sarkar)