  We calculate the free energies $F$ for $U(1)$ gauge theories on the $d$
dimensional sphere of radius $R$. For the theory with free Maxwell action we
find the exact result as a function of $d$; it contains the term $\frac{d-4}{2}
\log R$ consistent with the lack of conformal invariance in dimensions other
than 4. When the $U(1)$ gauge theory is coupled to a sufficient number $N_f$ of
massless 4 component fermions, it acquires an interacting conformal phase,
which in $d<4$ describes the long distance behavior of the model. The conformal
phase can be studied using large $N_f$ methods. Generalizing the $d=3$
calculation in arXiv:1112.5342, we compute its sphere free energy as a function
of $d$, ignoring the terms of order $1/N_f$ and higher. For finite $N_f$,
following arXiv:1409.1937 and arXiv:1507.01960, we develop the $4-\epsilon$
expansion for the sphere free energy of conformal QED$_d$. Its extrapolation to
$d=3$ shows very good agreement with the large $N_f$ approximation for $N_f>3$.
For $N_f$ at or below some critical value $N_{\rm crit}$, the $SU(2N_f)$
symmetric conformal phase of QED$_3$ is expected to disappear or become
unstable. By using the $F$-theorem and comparing the sphere free energies in
the conformal and broken symmetry phases, we show that $N_{\rm crit}\leq 4$. As
another application of our results, we calculate the one loop beta function in
conformal QED$_6$, where the gauge field has a 4-derivative kinetic term. We
show that this theory coupled to $N_f$ massless fermions is asymptotically
free.
