It is known that the L-function of an elliptic curve defined over $${\mathbb{Q}}$$ Q is given by the Mellin transform of a modular form of weight 2. Does that modular form have anything to do with string theory? In this article, we address a question along this line for elliptic curves that have complex multiplication defined over number fields. So long as we use diagonal rational $${\mathcal{N}=(2,2)}$$ N = ( 2 , 2 ) superconformal field theories for the string-theory realizations of the elliptic curves, the weight-2 modular form turns out to be the Boltzmann-weighted ( $${q^{L_0-c/24}}$$ q L 0 - c / 24 -weighted) sum of U(1) charges with $${Fe^{\pi i F}}$$ F e π i F insertion computed in the Ramond sector.