Where the field comes from
The Earth’s magnetic field is generated in the outer core, a layer of liquid iron and nickel about 2,900 kilometers below the surface. The metal there is extremely hot, close to the temperature of the Sun's surface, and it is always moving. As the inner core slowly cools and solidifies, it releases heat. That heat pushes the liquid metal upward, and cooler metal sinks to take its place. Earth's rotation twists these flows into spirals.
Moving liquid metal conducts electricity, and electric currents produce magnetic fields. The resulting field affects the motion of the metal, which keeps the currents going. This self-sustaining process is called a geodynamo.
The field does not come from a permanent magnet inside the planet. Iron loses its magnetism at high temperatures, and the core is far above that limit, so the field has to be continually regenerated. If the flow in the core stopped, the field would decay over tens of thousands of years.
At the surface the field is fairly weak. A typical refrigerator magnet is about a hundred times stronger. What makes Earth's field effective is its size as it extends tens of thousands of kilometers into space.
The shape of the field
Textbooks usually show the field as a bar magnet with smooth, symmetrical loops. That is a useful starting point, but the real field is more complicated. It is stronger in some regions and weaker in others, and these patterns shift slowly over time.
The Sun also shapes the field. The solar wind presses on the side of Earth facing the Sun, so the field only extends about 60,000 kilometers in that direction. On the night side, the field is stretched into a long tail that reaches millions of kilometers.
This region is called the magnetosphere. Where the solar wind meets it, a shock wave forms, similar to the wave at the front of a moving boat. The particles slow down and heat up, and most of them are deflected around the sides.
What the field protects us from
The Sun constantly releases charged particles, mostly protons and electrons, in all directions. This is the solar wind, and it travels at roughly 400 kilometers per second. Earth's magnetic field deflects most of it, so only a small fraction reaches the upper atmosphere, mainly near the poles.
Mars shows what can happen without that protection. It once had a magnetic field and a thicker atmosphere, and there is strong evidence of liquid water on its surface. After its core cooled and the field shut down, the solar wind helped strip away much of the atmosphere. NASA's MAVEN spacecraft has measured this loss directly, and the results suggest it was a major factor in Mars becoming cold and dry.
Auroras
Some solar wind particles do enter the atmosphere. They follow the field lines toward the poles, where the lines point down into the planet. At around 100 kilometers altitude, they collide with oxygen and nitrogen atoms in the upper atmosphere.
Each collision transfers energy to an atom. When the atom returns to its normal state, it releases that energy as light. This is the same basic process used in neon signs. Many collisions happening at once produce the glowing bands and curtains we call auroras.
The color depends on the gas and the altitude. Oxygen at about 100 to 150 kilometers produces green, the most common color. Oxygen at higher altitudes produces red. Nitrogen can add blue and purple, usually near the lower edge of the display.
Auroras happen at both poles. The northern lights are called the aurora borealis, and the southern lights are the aurora australis. During strong solar storms, auroras can be seen much farther from the poles than usual. In May 2024, a major storm made them visible across parts of the United States and Europe, well outside the usual range.
To watch for auroras, NOAA's Space Weather Prediction Center publishes an aurora forecast. It includes the Kp index, and a higher Kp means the aurora may be visible farther from the poles.
How the field changes
The magnetic field is not fixed. The magnetic north pole, the point where the field points straight down, has moved over time. For centuries it stayed in the Canadian Arctic. Starting in the 1990s it sped up, moving as much as about 50 kilometers per year toward Siberia. Navigation models had to be updated early to account for it. The movement has slowed in recent years.
These changes come from the same source as the field itself, the motion of liquid metal in the outer core.
The strength of the field also varies by location. Over the South Atlantic there is a region called the South Atlantic Anomaly where the field is noticeably weaker. Satellites passing through it receive more radiation, and some operators turn off sensitive instruments during the crossing. The Hubble Space Telescope does not take observations while passing through this region.
Magnetic reversals
Earth's magnetic poles have swapped places many times in the past. During a reversal, a compass would point south instead of north.
Scientists know this from the rock record. When volcanic rock cools, magnetic minerals in it line up with the field and keep that orientation. By dating layers of rock, geologists can reconstruct the field's direction through time. Hundreds of reversals have been identified. The most recent full reversal happened about 780,000 years ago.
Reversals do not follow a regular schedule. Sometimes they are separated by a few hundred thousand years, and there have been intervals of tens of millions of years with none. A reversal also takes a long time, typically thousands of years. During that period the field is weaker and more complex, and there can be several magnetic poles at once.
The field has lost about 10 percent of its strength over the past two centuries. Researchers do not generally treat this as a sign that a reversal is coming soon, since the field has fluctuated in similar ways before. Life has survived many past reversals.
How animals use it
Many animals appear to sense Earth's magnetic field and use it to navigate. Sea turtles are a well-studied example. After hatching, they swim out into the open ocean, and years later they return to the region where they were born to lay eggs. Field strength and direction vary slightly from place to place, and the turtles seem to learn the magnetic signature of their home coast. Birds, salmon, lobsters, and some bats show similar abilities.
How they detect the field is still unsettled. One hypothesis involves light-sensitive proteins in birds' eyes called cryptochromes, which may react differently depending on the angle of the field. If that is correct, birds might perceive the field as a visual pattern. This has not been confirmed.
Effects on technology
Solar storms can disturb Earth's magnetic field, and those disturbances can affect technology. In 1859, a very large storm known as the Carrington Event caused telegraph systems to fail, shocked some operators, and produced auroras visible near the tropics. At that time there was very little electrical infrastructure.
In March 1989, a much smaller storm caused a power outage across Quebec that lasted about nine hours. A storm on the scale of 1859 today could affect satellites, GPS, radio communications, and power grids. For this reason, agencies now monitor solar activity and issue space weather forecasts.
Sources
1. U.S. Geological Survey (USGS). Introduction to Geomagnetism. https://www.usgs.gov/programs/geomagnetism/introduction-geomagnetism
2. NASA Science. Magnetospheres. https://science.nasa.gov/heliophysics/focus-areas/magnetosphere-ionosphere/
3. NASA Science (2024). Ten Years at Mars With NASA's MAVEN Mission. https://science.nasa.gov/resource/ten-years-at-mars-with-nasas-maven-mission/
4. NOAA Space Weather Prediction Center. Aurora Tutorial. https://www.spaceweather.gov/content/aurora-tutorial
5. NASA Earth Observatory (2024). Historic Geomagnetic Storm Dazzles. https://science.nasa.gov/earth/earth-observatory/historic-geomagnetic-storm-dazzles-152815/
6. NOAA National Centers for Environmental Information (2026). 2025 World Magnetic Model Annual Report Is Released. https://www.ncei.noaa.gov/news/2025-wmm-annual-report-released
7. Space Telescope Science Institute. Hubble Space Telescope Primer: Orbital Constraints. https://hst-docs.stsci.edu/archives/hspcycle32/the-hubble-space-telescope-primer-for-cycle-32/hst-primer-orbital-constraints
8. U.S. Geological Survey (USGS). Is It True That Earth's Magnetic Field Occasionally Reverses Its Polarity? https://www.usgs.gov/faqs/it-true-earths-magnetic-field-occasionally-reverses-its-polarity
9. NASA Science (2021). Flip Flop: Why Variations in Earth's Magnetic Field Aren't Causing Today's Climate Change. https://science.nasa.gov/science-research/earth-science/flip-flop-why-variations-in-earths-magnetic-field-arent-causing-todays-climate-change/
10. Brothers, J. R., & Lohmann, K. J. (2015). Evidence for Geomagnetic Imprinting and Magnetic Navigation in the Natal Homing of Sea Turtles. Current Biology, 25(3), 392–396. https://doi.org/10.1016/j.cub.2014.12.035
11. Xu, J., et al. (2021). Magnetic Sensitivity of Cryptochrome 4 From a Migratory Songbird. Nature, 594, 535–540. https://doi.org/10.1038/s41586-021-03618-9
12. National Oceanic and Atmospheric Administration (NOAA). Space Weather: Storms From the Sun. https://www.noaa.gov/explainers/space-weather-storms-from-sun