The International Olympic Committee opened disciplinary proceedings against the 31 unidentified athletes from 12 countries who competed in Beijing and were planning to take part in the Rio de Janeiro Games in August.
The positive cases emerged from the recent retesting of 454 doping samples from Beijing with “the very latest scientific analysis methods,” the IOC said.
The Olympic body stores samples for 10 years to allow for retesting with improved techniques.
The IOC said it would inform the relevant national Olympic committees in the coming days.
“All those athletes infringing anti-doping rules will be banned from competing at the Olympic Games” in Rio, the IOC said after a teleconference meeting of its policy-making executive board.
Results of retesting of 250 samples from the London Olympics will be announced shortly, the IOC said. Those tests were also aimed at athletes planning to compete in Rio.
The IOC said it would also undertake a “wider retesting program” of medalists from both the Beijing and London Games.
Samples of athletes who could be promoted to medals following disqualification of drug cheats will also be retested.
The IOC also asked the World Anti-Doping Agency to launch a “fully-fledged investigation” into allegations that the drug-testing system at the 2014 Winter Games in Sochi was subverted by Russian officials.