Optical second-harmonic generation (SHG) in reflection characterized variations in the second-order nonlinear optical susceptibility χ(2) of Ba1−xSrxTiO3 (BSTO) alloy films grown epitaxially on SrTiO3(001) (STO) as Sr molar ratio x changed from 0 to 1 and thickness from 10 to 50 nm. X-ray diffraction showed that BSTO films with x ≳ 0.1 were highly crystalline and compressively strained with out-of-plane (in-plane) lattice constant 4.09 > c > 3.97 (3.903 < a < 3.907 Å, pinned to substrate) for 0 < x < 1. Spectroscopic ellipsometry showed that the BSTO dielectric function was nearly x-invariant in the range of fundamental (780 nm) and SH (390 nm) wavelengths. SHG intensity peaked at x ∼ 0.3 for a given film thickness, suggesting that composition control can optimize ferroelectric and electro-optic properties of BSTO films grown on STO buffer layers.