The Sun today is roughly halfway through the most stable part of its life. It has not changed dramatically for over four billion
[a] years, and will remain fairly stable for more than five billion more. However, after hydrogen fusion in its core has stopped, the Sun will undergo severe changes, both internally and externally.
The Sun formed about 4.6 billion years ago from the collapse of part of a giant
molecular cloud that consisted mostly of hydrogen and helium and that probably gave birth to many other stars.
 This age is estimated using
computer models of
stellar evolution and through
 The result is consistent with the
radiometric date of the oldest Solar System material, at 4.567 billion years ago.
 Studies of ancient
meteorites reveal traces of stable daughter nuclei of short-lived isotopes, such as
iron-60, that form only in exploding, short-lived stars. This indicates that one or more supernovae must have occurred near the location where the Sun formed. A
shock wave from a nearby supernova would have triggered the formation of the Sun by compressing the matter within the molecular cloud and causing certain regions to collapse under their own gravity.
 As one fragment of the cloud collapsed it also began to rotate because of
conservation of angular momentum and heat up with the increasing pressure. Much of the mass became concentrated in the center, whereas the rest flattened out into a disk that would become the planets and other Solar System bodies. Gravity and pressure within the core of the cloud generated a lot of heat as it accreted more matter from the surrounding disk, eventually triggering
nuclear fusion. Thus, the Sun was born.
The Sun is about halfway through its
main-sequence stage, during which nuclear fusion reactions in its core fuse hydrogen into helium. Each second, more than four million
tonnes of matter are converted into energy within the Sun's core, producing
solar radiation. At this rate, the Sun has so far converted around 100 times the mass of Earth into energy, about 0.03% of the total mass of the Sun. The Sun will spend a total of approximately 10
billion years as a main-sequence star.
 The Sun is gradually becoming hotter during its time on the main sequence, because the helium atoms in the core occupy less volume than the
hydrogen atoms that were fused. The core is therefore shrinking, allowing the outer layers of the Sun to move closer to the centre and experience a stronger gravitational force, according to the
inverse-square law. This stronger force increases the pressure on the core, which is resisted by a gradual increase in the rate at which fusion occurs. This process speeds up as the core gradually becomes denser. It is estimated that the Sun has become 30% brighter in the last 4.5 billion years.
 At present, it is increasing in brightness by about 1% every 100 million years.
After core hydrogen exhaustion
The size of the current Sun (now in the
) compared to its estimated size during its red-giant phase in the future
The Sun does not have enough mass to explode as a
supernova. Instead it will exit the
main sequence in approximately 5 billion years and start to turn into a
 As a red giant, the Sun will grow so large that it will engulf Mercury, Venus, and probably Earth.
Even before it becomes a red giant, the luminosity of the Sun will have nearly doubled, and Earth will receive as much sunlight as Venus receives today. Once the core hydrogen is exhausted in 5.4 billion years, the Sun will expand into a
subgiant phase and slowly double in size over about half a billion years. It will then expand more rapidly over about half a billion years until it is over two hundred times larger than today and a couple of thousand times more luminous. This then starts the
red-giant-branch phase where the Sun will spend around a billion years and lose around a third of its mass.
Evolution of a Sun-like star. The track of a one solar mass star on the
is shown from the main sequence to the post-asymptotic-giant-branch stage.
After the red-giant branch the Sun has approximately 120 million years of active life left, but much happens. First, the core, full of
degenerate helium ignites violently in the
helium flash, where it is estimated that 6% of the core, itself 40% of the Sun's mass, will be converted into carbon within a matter of minutes through the
 The Sun then shrinks to around 10 times its current size and 50 times the luminosity, with a temperature a little lower than today. It will then have reached the
red clump or
horizontal branch, but a star of the Sun's mass does not evolve blueward along the horizontal branch. Instead, it just becomes moderately larger and more luminous over about 100 million years as it continues to burn helium in the core.
When the helium is exhausted, the Sun will repeat the expansion it followed when the hydrogen in the core was exhausted, except that this time it all happens faster, and the Sun becomes larger and more luminous. This is the
asymptotic-giant-branch phase, and the Sun is alternately burning hydrogen in a shell or helium in a deeper shell. After about 20 million years on the early asymptotic giant branch, the Sun becomes increasingly unstable, with rapid mass loss and
thermal pulses that increase the size and luminosity for a few hundred years every 100,000 years or so. The thermal pulses become larger each time, with the later pulses pushing the luminosity to as much as 5,000 times the current level and the radius to over 1 AU.
 According to a 2008 model, Earth's orbit is shrinking due to
tidal forces (and, eventually, drag from the lower
chromosphere), so that it will be engulfed by the Sun near the tip of the red giant branch phase, 1 and 3.8 million years after Mercury and Venus have respectively suffered the same fate. Models vary depending on the rate and timing of mass loss. Models that have higher mass loss on the red-giant branch produce smaller, less luminous stars at the tip of the asymptotic giant branch, perhaps only 2,000 times the luminosity and less than 200 times the radius.
 For the Sun, four thermal pulses are predicted before it completely loses its outer envelope and starts to make a
planetary nebula. By the end of that phase – lasting approximately 500,000 years – the Sun will only have about half of its current mass.
The post-asymptotic-giant-branch evolution is even faster. The luminosity stays approximately constant as the temperature increases, with the ejected half of the Sun's mass becoming ionised into a
planetary nebula as the exposed core reaches 30,000 K. The final naked core, a
white dwarf, will have a temperature of over 100,000 K, and contain an estimated 54.05% of the Sun's present day mass.
 The planetary nebula will disperse in about 10,000 years, but the white dwarf will survive for trillions of years before fading to a hypothetical