We study an index for three-dimensional supersymmetric gauge theories placed on a sphere and immersed in external magnetic fields — in fact topologically twisted. We find an exact non-perturbative formula for this index, applying supersymmetric localization techniques. The index, different from the more common superconformal index, counts Landau-level ground states of the theories in magnetic field. It has physical applications: to the study of non-perturbative dualities, of moduli spaces, of Chern-Simons theory and Verlinde algebras, of wrapped branes in string theory and the quantum entropy of black holes; as well as mathematical applications: to quantum cohomology and its K-theoretic generalization.