When Will The Sun Die?
All stars go through a life cycle: they form, they spend most of their lives fusing hydrogen in their cores, and eventually they die. The death looks very different depending on the mass of the star. The most massive stars end as supernovae, leaving behind neutron stars or black holes. The Sun is not in that category. It is a middle-mass main sequence star with about 4.6 billion years behind it and around 5 billion years of stable hydrogen fusion still ahead. After that, it will go through a sequence of distinct evolutionary phases, ballooning to many times its current size, fusing heavier elements briefly, shedding its outer envelope as a planetary nebula, and finally settling into a slowly cooling white dwarf no bigger than Earth. The whole sequence is well constrained by stellar physics, and it is more interesting than the simple "red giant, then white dwarf" version often described.
The Sun Today: A Main Sequence Star

The Sun is currently a main sequence star, meaning the energy radiating from its surface comes from hydrogen fusion in its core. The dominant reaction at the Sun's mass is the proton-proton chain, in which four hydrogen nuclei combine through a series of intermediate steps to form one helium nucleus, releasing energy in the form of gamma rays, neutrinos, and the kinetic energy of the resulting particles. The Sun fuses roughly 600 million tons of hydrogen into helium every second. Despite the staggering rate, the core contains so much hydrogen that the supply will last about 10 to 11 billion years total. With about 4.6 billion years already burned, the Sun is roughly 45% of the way through its main sequence life.
Total solar diameter is roughly 1.39 million kilometers, or about 864,000 miles. The Sun is in hydrostatic equilibrium: the outward push of radiation pressure and gas pressure from fusion balances the inward pull of gravity. As long as fusion continues steadily in the core, this balance holds, and the Sun's size and luminosity change only gradually.
The Slow Brightening

The "stable" main sequence phase is not perfectly stable. As hydrogen fuses to helium in the core, the average particle weight increases, the core slowly contracts, and the core temperature rises. Higher core temperatures mean a faster fusion rate and higher luminosity. The Sun is brightening by roughly 1% every 100 million years.
This has consequences for Earth long before the Sun leaves the main sequence. In about 1 billion years, the Sun will be roughly 10% brighter than today. That extra heat is enough to push Earth into a moist greenhouse state, where water vapor in the upper atmosphere is broken apart by ultraviolet radiation and the resulting hydrogen escapes to space. By around 1.5 to 2 billion years from now, the oceans will have boiled off entirely, and Earth's surface will be a sterilized rock far hotter than today's Venus. Life on Earth is constrained by solar luminosity, not by the red giant phase, and the planet's habitable window will close billions of years before any of the dramatic late-stage events.
The End of the Main Sequence

About 5 billion years from now, hydrogen in the Sun's core will be exhausted. The core will be left with a hot, inert ball of helium "ash," with no fusion happening at the center. Without core fusion, gravity wins, and the helium core begins to contract and heat up. The contraction warms a surrounding shell of hydrogen to fusion temperatures, and hydrogen shell burning begins. This shell-burning phase is more luminous than core burning was, and the extra energy pushes the outer envelope of the Sun outward and cools it. The Sun enters the subgiant phase: a transitional period during which it grows steadily larger and slightly cooler at the surface while shining more brightly overall.
The Red Giant Branch
The subgiant phase ends as the Sun ascends what astronomers call the red giant branch, or RGB. Hydrogen shell burning intensifies. The outer envelope expands enormously while the surface cools to around 3,000 to 4,000 K, dropping the Sun's color from yellow-white to deep orange-red. By the tip of the RGB, the Sun's radius will have ballooned to roughly 100 times its current value, and its luminosity will be a few thousand times what it is today. The whole RGB ascent takes roughly 1 to 2 billion years.
While this is happening, the helium core continues to contract under gravity. Helium fusion requires a much higher temperature than hydrogen fusion, around 100 million K, because the relevant reaction (the triple-alpha process) requires three helium nuclei to come together almost simultaneously. The contracting core climbs toward that temperature throughout the RGB phase. When it gets there, things change abruptly.
The Helium Flash and the Horizontal Branch
For stars between roughly 0.4 and 2.5 solar masses, including the Sun, the helium core has become electron-degenerate by the time it reaches helium fusion temperature. Degenerate matter is supported not by thermal pressure but by quantum mechanical pressure between electrons, which means the core's pressure no longer responds to changes in temperature in the normal way. When helium fusion ignites in this degenerate core, the energy release does not cause the core to expand and cool, as it would in a normal gas. Instead, temperature spikes and the fusion rate runs away in a few seconds, producing a brief but immense burst of energy known as the helium flash.
Most of the energy from the helium flash is absorbed internally; almost none of it reaches the surface. The flash lifts the core out of its degenerate state. Once the core is no longer degenerate, helium fusion settles into a stable, longer-lived burn that lasts about 100 million years. During this phase, the Sun sits on what is called the horizontal branch on stellar diagrams. Helium fuses through the triple-alpha process to form carbon, and a fraction of the carbon captures an additional helium nucleus to form oxygen. Contrary to what is sometimes said, the Sun's core is dense and hot enough to fuse helium. What it cannot do is fuse beyond carbon and oxygen, because doing so would require the kind of core temperatures only achieved in stars more massive than about eight solar masses.
The Asymptotic Giant Branch

The remnant of a supernova observed in 1572, notably studied by the Danish astronomer Tycho Brahe, lies about 13,000 light-years away in the constellation Cassiopeia. In this composite image, data from NASA’s Chandra X-ray Observatory have been combined with an optical image of stars in the same area. X-ray: NASA/CXC/RIKEN & GSFC/T. Sato et al; Optical: DSS
When core helium runs out, the Sun is left with an inert carbon-oxygen core surrounded by a thin shell where helium continues to fuse, with another shell of fusing hydrogen above that. The structure is similar to the RGB phase, just with an additional layer. The energy from these two burning shells drives a second envelope expansion that carries the Sun back into the giant region of the stellar diagram. This is the asymptotic giant branch, or AGB.
At one solar mass, the AGB radius can reach roughly 1 astronomical unit, which is the current orbital radius of Earth, and at the upper end of model predictions can extend to about 1.5 AU. AGB luminosity climbs to several thousand times the current solar value, and surface temperature drops to around 3,000 K. The AGB is divided into two stages. In the early AGB, helium shell burning dominates. In the thermally pulsing AGB that follows, the helium shell becomes unstable and ignites in periodic flashes roughly every 100,000 years. Each pulse drives convection deep into the star, dredges material up from the deep interior, and helps push mass off the surface in powerful stellar winds.
Mass loss during the AGB is the central event of the Sun's late life. By the time the AGB ends, the Sun will have shed roughly half of its current mass into space.
What Happens to the Planets
The fate of the planets depends on two competing effects. As the Sun loses mass, its gravitational pull on the planets weakens, and the planets' orbits expand outward. At the same time, as the solar envelope swells outward, planets close enough to be inside or near the photosphere experience tidal drag and direct atmospheric resistance, both of which pull them inward.
Mercury and Venus do not survive. Both are too close, and both are engulfed and destroyed during the late RGB phase. Mercury goes first, then Venus.
The fate of Earth is more contested. Older calculations that ignored tidal effects suggested Earth's orbit would expand fast enough to keep it ahead of the swelling Sun. The more thorough analysis published by Klaus-Peter Schröder and Robert Smith in Monthly Notices of the Royal Astronomical Society in 2008 included tidal interaction with the Sun's slowed rotation, and concluded that Earth will be engulfed. In their model, the Sun reaches its tip-of-RGB radius about 7.59 billion years from now, and Earth is dragged into the solar envelope about 500,000 years before that maximum is reached. Schröder and Smith estimated that any planet currently inside about 1.15 AU is doomed. More recent work has refined the picture and noted that orbital evolution at this stage has stochastic elements, but the overall conclusion that Earth is most likely engulfed has held up.
Mars, at 1.52 AU, is far enough out that the orbital expansion from solar mass loss should keep it clear of even the AGB envelope. Mars survives, although its surface conditions during the AGB phase will be extreme. The outer planets, all far beyond the swollen solar radius, definitely survive, and at the peak of the AGB the loose definition of a "habitable zone" briefly extends out into the Kuiper Belt, although none of the bodies out there have any chance of becoming Earth-like in that timeframe.
The Planetary Nebula

The Helix nebula, imaged here, lies 650 light-years away in the constellation Aquarius. Also known as NGC 7293, it is a typical example of planetary nebulae. - NASA/JPL-Caltech
By the late thermal pulses of the AGB, the outer envelope of the Sun is loosely bound and being driven off in increasingly powerful winds. Eventually the envelope is ejected entirely. What remains is the hot, exposed carbon-oxygen core, with a surface temperature initially over 100,000 K. The intense ultraviolet radiation from this exposed core ionizes the surrounding ejected gas, causing it to glow. The result is a planetary nebula, the kind of structure visible today in objects like the Ring Nebula in Lyra and the Cat's Eye Nebula in Draco. Despite the name, planetary nebulae have nothing to do with planets; the term comes from their roughly disk-like appearance through 18th-century telescopes.
A planetary nebula is a brief phenomenon. The expanding gas dissipates into the interstellar medium over roughly 10,000 to 20,000 years, which is essentially nothing on stellar timescales. After the nebula fades, what is left of the Sun is just the core.
The White Dwarf Phase
The exposed core is the white dwarf. It has roughly half the Sun's current mass packed into a sphere about the size of Earth, giving it a density of around one ton per cubic centimeter. Nothing is fusing inside it. The white dwarf is held against further gravitational collapse not by thermal pressure but by electron degeneracy pressure, the same quantum mechanical effect that briefly stabilized the helium flash core. Degenerate pressure does not depend on temperature, so the white dwarf can cool indefinitely without shrinking.
And cool it does. The white dwarf will start at over 100,000 K and radiate away its residual heat over an extraordinarily long timeline. After roughly 1 billion years it will have cooled to a faint red. After tens of billions of years it will be barely visible. Eventually, on timescales of trillions of years, far longer than the current age of the universe, it will fade to a cold, dark object known as a black dwarf. No black dwarfs exist in the universe yet because not enough time has passed since the first stars formed for any white dwarf to have cooled that far.
Why the Sun Will Not Go Supernova
The Sun's death is dramatic on a human scale but quiet on a stellar one. Supernovae are reserved for stars with initial masses above roughly 8 solar masses, which are massive enough to fuse carbon, then oxygen, then progressively heavier elements all the way up to iron. Once iron forms, fusion stops releasing net energy, the core collapses catastrophically, and the resulting shock wave produces the supernova. The Sun does not have the mass to start carbon fusion, let alone reach iron. Its core will simply contract to white dwarf density and stop, with the outer envelope drifting away as a nebula. The end is a slow, quiet fade rather than an explosion.
Timeline at a Glance
From today's vantage, the rough sequence runs as follows: in 1 billion years, Earth's oceans begin to boil from rising solar luminosity. In about 5 billion years, hydrogen in the Sun's core is exhausted and the main sequence ends. Over the following 1 to 2 billion years, the Sun ascends the red giant branch, swelling to about 100 times its current radius. The helium flash ignites core helium fusion, and the Sun spends roughly 100 million years on the horizontal branch fusing helium to carbon and oxygen. The asymptotic giant branch follows, with the Sun expanding to roughly 1 AU and shedding about half its mass through stellar winds. Mercury and Venus are engulfed; Earth most likely follows; Mars and the outer planets survive. The outer envelope is ejected and ionized, glowing for roughly 10,000 years as a planetary nebula. What remains is a slowly cooling white dwarf the size of Earth, which will continue to cool for trillions of years before becoming a dark, inert black dwarf. The Sun will never explode.