The sun lies at the heart of the solar system, where it is by far the largest object. It holds 99.8% of the solar system's mass and is roughly 109 times the diameter of the Earth — about one million Earths could fit inside the sun.
The surface of the sun is about 10,000 degrees Fahrenheit (5,500 degrees Celsius) hot, while temperatures in the core reach more than 27 million F (15 million C), driven by nuclear reactions. One would need to explode 100 billion tons of dynamite every second to match the energy produced by the sun, according to NASA.
The sun is one of more than 100 billion stars in the Milky Way. It orbits some 25,000 light-years from the galactic core, completing a revolution once every 250 million years or so. The sun is relatively young, part of a generation of stars known as Population I, which are relatively rich in elements heavier than helium. An older generation of stars is called Population II, and an earlier generation of Population III may have existed, although no members of this generation are known yet.
Related: How hot is the sun?
How the sun formed
The sun was born about 4.6 billion years ago. Many scientists think the sun and the rest of the solar system formed from a giant, rotating cloud of gas and dust known as the solar nebula. As the nebula collapsed because of its gravity, it spun faster and flattened into a disk. Most of the material was pulled toward the center to form the sun.
Related: How was the sun formed?
The sun has enough nuclear fuel to stay much as it is now for another 5 billion years. After that, it will swell to become a red giant. Eventually, it will shed its outer layers, and the remaining core will collapse to become a white dwarf. Slowly, the white dwarf will fade, and will enter its final phase as a dim, cool theoretical object sometimes known as a black dwarf.
Related: When will the sun die?
Internal structure and atmosphere of the sun
The sun and the atmosphere of the sun are divided into several zones and layers. The solar interior, from the inside out, is made up of the core, radiative zone and the convective zone. The solar atmosphere above that consists of the photosphere, chromosphere, a transition region and the corona. Beyond that is the solar wind, an outflow of gas from the corona.
The core extends from the sun's center to about a quarter of the way to its surface. Although it only makes up roughly 2% of the sun's volume, it is almost 15 times the density of lead and holds nearly half of the sun's mass. Next is the radiative zone, which extends from the core to 70% of the way to the sun's surface, making up 32 % of the sun's volume and 48% of its mass. Light from the core gets scattered in this zone, so that a single photon often may take a million years to pass through.
The convection zone reaches up to the sun's surface, and makes up 66% of the sun's volume but only a little more than 2% of its mass. Roiling "convection cells" of gas dominate this zone. Two main kinds of solar convection cells exist — granulation cells about 600 miles (1,000 kilometers) wide and supergranulation cells about 20,000 miles (30,000 km) in diameter.
The photosphere is the lowest layer of the sun's atmosphere, and emits the light we see. It is about 300 miles (500 km) thick, although most of the light comes from its lowest third. Temperatures in the photosphere range from 11,000 F (6,125 C) at the bottom to 7,460 F (4,125 C) at the top. Next up is the chromosphere, which is hotter, up to 35,500 F (19,725 C), and is apparently made up entirely of spiky structures known as spicules typically some 600 miles (1,000 km) across and up to 6,000 miles (10,000 km) high.
After that is the transition region a few hundred to a few thousand miles thick, which is heated by the corona above it and sheds most of its light as ultraviolet rays. At the top is the super-hot corona, which is made of structures such as loops and streams of ionized gas. The corona generally ranges from 900,000 F (500,000 C) to 10.8 million F (6 million C) and can even reach tens of millions of degrees when a solar flare occurs. Matter from the corona is blown off as the solar wind.
Related: Space weather: Sunspots, solar flares & coronal mass ejections
The sun's magnetic field
The sun's magnetic field is typically only about twice as strong as Earth's magnetic field. However, it becomes highly concentrated in small areas, reaching up to 3,000 times stronger than usual. These kinks and twists in the magnetic field develop because the sun spins more rapidly at the equator than at higher latitudes and because the inner parts of the sun rotate more quickly than the surface.
Related: Huge magnetic 'ropes' drive powerful sun explosions
These distortions create features ranging from sunspots to spectacular eruptions known as flares and coronal mass ejections. Flares are the most violent eruptions in the solar system, while coronal mass ejections are less violent but involve extraordinary amounts of matter — a single ejection can spout roughly 20 billion tons (18 billion metric tons) of matter into space.
Chemical composition of the sun
Just like most other stars, the sun is made up mostly of hydrogen, followed by helium. Nearly all the remaining matter consists of seven other elements — oxygen, carbon, neon, nitrogen, magnesium, iron and silicon. For every 1 million atoms of hydrogen in the sun, there are 98,000 of helium, 850 of oxygen, 360 of carbon, 120 of neon, 110 of nitrogen, 40 of magnesium, 35 of iron and 35 of silicon. Still, hydrogen is the lightest of all elements, so it only accounts for roughly 72% of the sun's mass, while helium makes up about 26%.
Related: What is the sun made of?
Sunspots and solar cycles
Sunspots are relatively cool, dark features on the sun's surface that are often roughly circular. They emerge where dense bundles of magnetic field lines from the sun's interior break through the surface.
The number of sunspots varies as solar magnetic activity does — the change in this number, from a minimum of none to a maximum of roughly 250 sunspots or clusters of sunspots and then back to a minimum, is known as the solar cycle, and averages about 11 years long. At the end of a cycle, the magnetic field rapidly reverses its polarity.
Related: Largest sunspot in 24 years wows scientists, but also mystifies
History of observing the sun
Ancient cultures often modified natural rock formations or built stone monuments to mark the motions of the sun and moon, charting the seasons, creating calendars and monitoring eclipses. Many believed the sun revolved around the Earth, with the ancient Greek scholar Ptolemy formalizing this "geocentric" model in 150 B.C. Then, in 1543, Nicolaus Copernicus described a heliocentric (sun-centered) model of the solar system, and in 1610, Galileo Galilei's discovery of Jupiter's moons confirmed that not all heavenly bodies circled Earth.
To learn more about how the sun and other stars work, after early observations using rockets, scientists began studying the sun from Earth orbit. NASA launched a series of eight orbiting observatories known as the Orbiting Solar Observatory between 1962 and 1971. Seven of them were successful, and analyzed the sun at ultraviolet and X-ray wavelengths and photographed the super-hot corona, among other achievements.
In 1990, NASA and the European Space Agency launched the Ulysses probe to make the first observations of its polar regions. In 2004, NASA's Genesis spacecraft returned samples of the solar wind to Earth for study. In 2007, NASA's double-spacecraft Solar Terrestrial Relations Observatory (STEREO) mission returned the first three-dimensional images of the sun. NASA lost contact with STEREO-B in 2014, which remained out of contact except for a brief period in 2016. STEREO-A remains fully functional.
The Solar and Heliospheric Observatory (SOHO), which last year celebrated 25 years in space, has been one of the most important solar missions to date. Designed to study the solar wind, as well as the sun's outer layers and interior structure, it has imaged the structure of sunspots below the surface, measured the acceleration of the solar wind, discovered coronal waves and solar tornadoes, found more than 1,000 comets, and revolutionized our ability to forecast space weather.
The Solar Dynamics Observatory (SDO), launched in 2010, has returned never-before-seen details of material streaming outward and away from sunspots, as well as extreme close-ups of activity on the sun's surface and the first high-resolution measurements of solar flares in a broad range of extreme ultraviolet wavelengths.
The newest addition to the sun-observing fleet are NASA's Parker Solar Probe, launched in 2018, and ESA/NASA Solar Orbiter, launched in 2020. Both of these spacecraft orbit the sun closer than any spacecraft before, taking complementary measurements of the environment in the vicinity of the star.
During its close passes, the Parker Solar Probe dives into the sun's outer atmosphere, the corona, having to withstand temperatures hotter than one million degrees Fahrenheit. At its nearest, the Parker Solar Probe will fly merely 4 million miles (6.5 million km) to the sun's surface (the distance between the sun and Earth is 93 million miles (150 million km)). The measurements it makes are helping scientists learn more about how energy flows through the sun, the structure of the solar wind, and how energetic particles are accelerated and transported.
Related: NASA Parker Solar Probe nails close flyby of sun as its space weather cycle ramps up
While Solar Orbiter doesn't fly as close as the Parker Solar Probe, it is equipped with high-tech cameras and telescopes that take images of the sun's surface from the closest distance ever. It was not technically possible for the Parker Solar Probe to carry a camera that would look directly at the sun's surface.
At its closest, Solar Orbiter will pass at about 26 million miles (43 million km) away from the star — about 25% closer than Mercury. During its first perihelion, the point in its elliptical orbit closest to the sun, the spacecraft approached the sun to about half the distance from earth. The images acquired during the first perihelion, released in June last year, were the closest images of the sun ever taken and revealed previously unseen features on the star's surface — miniature flares dubbed the campfires.
After Solar Orbiter completes a few close passes, mission controllers will start elevating its orbit out of the ecliptic plane in which planets orbit, to enable the spacecraft's cameras to take the first ever close-up images of the sun's poles. Mapping the activity in the polar regions will help scientists better understand the sun's magnetic field, which drives the 11-year solar cycle.
This article was updated on June 9, 2021 by Space.com senior writer Tereza Pultarova.