Abstract: I will discuss two-dimensional CFTs that exhibit a hallmark feature of quantum chaos: universal repulsion of energy levels as described by a regime of linear growth of the spectral form factor. This physical input together with modular invariance strongly constrains the spectral correlations and the subleading corrections to the linear growth. I will demonstrate how these are determined by a trace formula, which highlights an interplay of universal physical properties of chaotic CFTs and analytic number theory. The trace formula manifests the fact that the simplest possible CFT correlations consistent with quantum chaos are those described by a Euclidean wormhole in AdS3 gravity with [torus]×[interval] topology. While the trace formula immediately provides these results, I will also discuss its mechanism in more detail; in particular, it is interesting to see how a decomposition of the spectral form factor into a set of modular invariant Maass cusp forms encodes quantum chaos.