The dual conformal field theory of pure or chiral gravity on AdS3 is believed to be an extremal conformal field theory. I explain constraints on such extremal conformal field theories that arise from the study of their modular differential equation. I also analyse the N=2 superconformal analogue of such theories and show that the modular constraints are sharper in this case.