The New Zealander Valerie Adams will now be awarded the gold, Russia’s Evgeniia Kolodko will take the silver and China’s Lijiao Gong will win the bronze.
Ostapchuk was tested twice, once on 5 August and again the following day after she had finished first in the women’s shot put.
The IOC says both samples indicated the presence of metenolone, which is classified as an anabolic agent under the 2012 prohibited list.
The shot putter has been retrospectively disqualified from the event, has been excluded from the Games, and will have her Olympic accreditation removed immediately as well as losing her gold medal.
Ostapchuk, 31, was competing in her third Olympic Games in London, and she finished fourth in Athens in 2004 and claimed bronze in Beijing four years ago.
She threw 21.36m with her third attempt as she comfortably won the shot put competition from Adams, who threw 20.70m.