We present forms of the classical Riesz–Kolmogorov theorem for compactness that are applicable in a wide variety of settings. In particular, our theorems apply to classify the precompact subsets of the Lebesgue space $$L^2$$ , Paley–Wiener spaces, weighted Bargmann–Fock spaces, and a scale of weighted Besov–Sobolev spaces of holomorphic functions that includes weighted Bergman spaces of general domains as well as the Hardy space and the Dirichlet space. We apply the compactness criteria to characterize the compact Toeplitz operators on the Bergman space, deduce the compactness of Hankel operators on the Hardy space, and obtain general umbrella theorems.