  We study the evolution of primordial magnetic fields until the recombination
epoch, which is constrained by the conservation of magnetic helicity density if
they are maximally helical and by the Hosking integral if they are non-helical.
We combine these constraints with conditions obtained by estimating time scales
of energy dissipation processes to describe the evolution of magnetic field
strength and magnetic coherence length analytically. The dissipation processes
depend on whether magnetic or kinetic energy is dominant, whether the decay
dynamics is linear or not, and whether the dominant dissipation term is shear
viscosity or drag force. We apply the description to compare constraints on
primordial magnetic fields at different epochs in the early universe and argue
that magnetogenesis before the electroweak symmetry breaking is not feasible.
