Magnetic fields are ubiquitous in the universe, threading through all kinds of celestial bodies. They play a critical role in the formation, radiation and evolution of all kinds of these objects, and are an agent for cosmic ray propagation. Previously, our understanding of cosmic magnetic fields mainly came from observations and theoretical explanations of the solar and geomagnetic fields. In the last two decades, much progress has been made in the measurement of magnetic fields on larger scales: ordered magnetic fields along the spiral arms have been discovered in our Milky Way with a strength of 2―4 microGauss and a scale of several tens of thousand light years; toroidal magnetic fields have been found in the halo of the Milky Way with reversed directions below and above the Galactic plane; evidence for poloidal magnetic fields has been found near the center of the Galactic center; large-scale ordered fields with a scale length of several tens of thousand light years have also been revealed in nearby spiral galaxies and even in the clusters of galaxies with a scale length of tens of million light years. Simulations of cosmological structure formations also show that magnetic fields should exist in the filament structure. These magnetic fields are probably primodial fields generated in the early universe and then amplified during the formation and evolution of the structure and stars or galaxies.