We put forward an operational degree of polarization that can be extended in a natural way to fields whose wave fronts are not necessarily planar. This measure appears as a distance from a state to the set of all its polarization-transformed counterparts. By using the Hilbert-Schmidt metric, the resulting degree is a sum of two terms: one is the purity of the state and the other can be interpreted as a classical distinguishability, which can be experimentally determined in an interferometric setup. For transverse fields, this reduces to the standard approach, whereas it allows one to get a straight expression for nonparaxial fields.