  We calculate the effect of magnetic fields on the magnetic dipole moment of
leptons up to the quadratic order in the magnetic field, including the QCD
contributions. Since the leading contribution, which is linear in the magnetic
field, depends on the spin, its effect is not measurable directly in the
Penning trap experiment for the electron dipole moment. In the muon anomaly,
however, we find that the electrons decayed from muons are refracted linearly
in the magnetic field. This effect, though quite small, changes the
distribution of the detected electrons in the muon $g-2$ experiment and could
be measurable, improving the experimental uncertainties. We also discuss the
general field-dependent form factors and the Ward-Takahashi identity under the
external magnetic fields.
