  The high-temperature plasma above the electroweak scale $\sim 100$ GeV may
have contained a primordial hypercharge magnetic field whose anomalous coupling
to the fermions induces a transformation of the hypermagnetic energy density
into fermionic number. In order to describe this process, we generalize the
ordinary magnetohydrodynamical equations to the anomalous case. We show that a
not completely homogeneous hypermagnetic background induces fermion number
fluctuations, which can be expressed in terms of a generic hypermagnetic field
configuration. We argue that, depending upon the various particle physics
parameters involved in our estimate (electron Yukawa coupling, strength of the
electroweak phase transition) and upon the hypermagnetic energy spectrum,
sizeable matter-antimatter fluctuations can be generated in the plasma. These
fluctuations may modify the predictions of the standard Big Bang
nucleosynthesis (BBN). We derive constraints on the magnetic fields from the
requirement that the homogeneous BBN is not changed. We analyse the influence
of primordial magnetic fields on the electroweak phase transition and show that
some specific configurations of the magnetic field may be converted into net
baryon number at the electroweak scale.
