We show that under minimal assumptions on a class of functions \(\mathcal {H}\) defined on a probability space \((\mathcal {X},\mu )\) , there is a threshold \(\Delta _0\) satisfying the following: for every \(\Delta \ge \Delta _0\) , with probability at least \(1-2\exp (-c\Delta m)\) with respect to \(\mu ^{\otimes m}\) , \(\begin{aligned} \sup _{h\in \mathcal {H}} \sup _{t\in \mathbb {R}} \left| \mathbb {P}(h(X)\le t) - \frac{1}{m}\sum _{i=1}^m 1_{(-\infty ,t]}(h(X_i)) \right| \le \sqrt{\Delta }; \end{aligned}\) here X is distributed according to \(\mu\) and \((X_i)_{i=1}^m\) are independent copies of X. The value of \(\Delta _0\) is determined by an unexpected complexity parameter of the class \(\mathcal {H}\) that captures the set’s geometry (Talagrand’s \(\gamma _1\) -functional). The bound, the probability estimate and the value of \(\Delta _0\) are all optimal up to a logarithmic factor.