Thin films of β-W are the most interesting for manipulating magnetic moments using spin–orbit torques, and a clear understanding of α to β phase transition in W by doping impurity, especially oxygen, is needed. Here we present a combined experimental and theoretical study using grazing incidence X-ray diffraction, photoelectron spectroscopy, electron microscopy, and ab initio calculations to explore atomic structure, bonding, and oxygen content for understanding the formation of β-W. It is found that the W films on SiO2/Si have 13–22 at.\% oxygen in A15 β structure. Ab initio calculations show higher solution energy of oxygen in β-W, and a tendency to transform locally from α to β phase with increasing oxygen concentration. X-ray absorption spectroscopy also revealed local geometry of oxygen in β-W, in agreement with the simulated one. These results offer an opportunity for a fundamental understanding of the structural transition in α-W and further development of β-W phase for device applications. © 2020, The Author(s).