Abstract. The insulator SrTiO 3 can host high-mobility twodimensional electron systems on its surfaces and at interfaces with other oxides. While for the bare surface a two-dimensional electron system can only be induced by oxygen vacancies, it is believed that the metallicity of heterostructure interfaces as in LaAlO 3/SrTiO3 is caused by other mechanisms related to the polar discontinuity at the interface. Based on calculations using density functional and dynamical mean-field theory as well as on experimental results using photoemission spectroscopy we elucidate the role of oxygen vacancies, thereby highlighting their importance for the electronic and magnetic properties of the systems under study.