  Magnetic fields in the early universe can significantly alter the thermal
evolution and the ionization history during the dark ages. This is reflected in
the 21 cm line of atomic hydrogen, which is coupled to the gas temperature
through collisions at high redshifts, and through the Wouthuysen-Field effect
at low redshifts. We present a semi-analytic model for star formation and the
build-up of a Lyman alpha background in the presence of magnetic fields, and
calculate the evolution of the mean 21 cm brightness temperature and its
frequency gradient as a function of redshift. We further discuss the evolution
of linear fluctuations in temperature and ionization in the presence of
magnetic fields and calculate the effect on the 21 cm power spectrum. At high
redshifts, the signal is increased compared to the non-magnetic case due to the
additional heat input into the IGM from ambipolar diffusion and the decay of
MHD turbulence. At lower redshifts, the formation of luminous objects and the
build-up of a Lyman alpha background can be delayed by a redshift interval of
10 due to the strong increase of the filtering mass scale in the presence of
magnetic fields. This tends to decrease the 21 cm signal compared to the
zero-field case. In summary, we find that 21 cm observations may become a
promising tool to constrain primordial magnetic fields.
