Magnetic fields are everywhere in nature and they play an important role in every astronomical environment which involves the formation of plasma and currents. It is natural therefore to suppose that magnetic fields could be present in the turbulent high temperature environment of the big bang. However, to date no such field has been detected. Such a primordial magnetic field (PMF), however, could manifest itself in the cosmic microwave background (CMB) temperature and polarization anisotropies, and also in the formation of large-scale structure. In this talk we will discuss the development of a new high-precision theoretical framework in which to probe the effects of magnetic fields on the CMB temperature and polarization anisotropies, along with the matter power spectrum. We will show prelimminary evidence that the existing accumulated data on both the matter and CMB power spectra on small angular scales fixes both the upper and lower limits to the magnetic field strength and power spectral index. We find that a maximum develops in the probability distribution for a magnitude of the PMF (on a comoving scale of at 1 Mpc) of B = 0.4 +1.6 -0.5 nG, while for the power spectral index we find n_B= -1.9 +0.7 -2.0. This result provides new constraints on models for magnetic field generation and the physics of the early universe. We also show that this finite magnetic field can be used to determine an independent constraint on the sum of the neutrino masses from their effect on the CMB polarization spectrum.