We establish a vector-valued John–Nirenberg inequality for oscillations measured in a Banach function space (B.f.s.) norm. This inequality generalizes several existing results on John–Nirenberg inequalities on function spaces such as rearrangement-invariant B.f.s. and Lebesgue spaces with variable exponents. Moreover, this inequality also offers a new characterization of BMO in terms of the weighted vector-valued mean oscillation.Mathematical Subject Classification42B3546E3042B25