I will explain how tools from the theory of modular forms may be used to resolve operator spectra of conformal field theories. This leads to a quantitative framework for diagnosing quantum chaos and random matrix behavior in field theory and gravity.