All stars form in nebulae, huge clouds of gas and dust.
Though they shine for thousands of years, stars do not last forever. The changes that occur in a star over time and the final stage of its life depends on a star's size.
The exact lifetime of a star depends very much on its size. Very massive stars use up their fuel quickly. This means they may only last a few hundred thousand years.
Smaller stars use fuel more slowly and will shine for several billion years.
Image
A diagram showing the stages in the life cycle of a star. "Creation" is at the top, also labelled "Stellar Nebula" along with a graphic of a pink swirly cloud. Two arrows point left and right with the label "Main Sequence". On the left is "High Mass Star", a blue circle, and arrows lead to the next stages which are "Red Supergiant", "Supernova", "Neutron Star" and "Black Hole". The right arrow leads to a "Low Mass Star", a yellow circle. Arrows then point to the next stages.
Credit
This work by The Schools' Observatory is licensed under All rights reserved
Eventually, the hydrogen that powers a star's nuclear reactions begins to run out. The star then enters the final phases of its lifetime. All stars will expand, cool and change colour to become a red giant or red supergiant.
What happens next depends on how massive the star is.
A smaller star, like the Sun, will gradually cool down and stop glowing. During these changes, it will go through the planetary nebula phase and white dwarf phase. After many thousands of millions of years, it will stop glowing and become a black dwarf.
A massive star experiences a much more energetic and violent end. It explodes as a supernova. This scatters materials from inside the star across space. This material can be collected in nebulae and form the next generation of stars.
After the dust clears, a very dense neutron star is left behind. These spin rapidly and can give off streams of radiation, known as pulsars. If the star is especially massive, it forms a black hole when it explodes.