The Sun is about halfway through its main-sequence evolution, during which nuclear fusion reactions in its core fuse hydrogen into helium. Each second, more than 4 million tonnes of matter are converted into energy within the Sun's core, producing neutrinos and solar radiation; at this rate, the Sun will have so far converted around 100 Earth-masses of matter into energy. The Sun will spend a total of approximately 10 billion years as a main-sequence star.
The Sun does not have enough mass to explode as a supernova. Instead, in 4–5billion years, it will enter a red giant phase, its outer layers expanding as the hydrogen fuel in the core is consumed and the core contracts and heats up. Helium fusion will begin when the core temperature reaches around 100 MK, and will produce carbon and oxygen, entering the asymptotic giant branch of a planetary nebula phase in about 7.8 billion years, during which instabilities in interior temperature lead the surface of the sun to shed mass. While it is likely that the expansion of the outer layers of the Sun will reach the current position of Earth's orbit, recent research suggests that mass lost from the Sun earlier in its red giant phase will cause the Earth's orbit to move further out, preventing it from being engulfed. However, Earth's water will be boiled away and most of its atmosphere will escape into space. The increase in solar temperatures over this period is sufficient that by about 500-700 million years into the future, the surface of the Earth will become too hot for the survival of life as we know it.