Barium strontium titanate thin films with different Ba/Sr ratios deposited by radio-frequency magnetron sputtering are studied with respect to their composition using in situ X-ray photoelectron spectroscopy. The deposited samples can be described as either titanium-rich or stoichiometric, with cation B/A ratios (i.e., ratios between the Ti and (Ba þ Sr) concentrations) of 1.2-1.6 or 0.7-1.0, respectively. Volume sensitive compositional analysis using transmission electron microscopy shows a non-stoichiometry, which is less pronounced than at the surface. X-ray diffraction only shows cubic perovskite reflections. Together with photoelectron binding energy differences and full widths at half maxima of the Ti 2p and O 1s emissions, this indicates that all films consist of a single phase. The relation between oxygen concentration and B/A ratio further indicates that the deviation of stoichiometry is accommodated by removal or insertion of (Ba,Sr)O. The higher variation of (Ba,Sr)O content near the surface as compared to the bulk may be associated to an increased strain, which is proposed to contribute to surface roughening.