Oxygen deficient yolk–shell BiO2−x microspheres prepared by facile solvothermal method showed great inactivation ability toward Escherichia coli, due to its enhanced light absorption ability and separation ability of photoinduced carriers. Reactive species O2− and H2O2 guaranteed this prominent oxidation ability toward bacterial cells.