It all started with a cloud of dust and gas.
Long before the Earth or anything else in the solar system existed — indeed, before there even was a solar system — there was a massive molecular cloud. Dark and dense, it was nevertheless full of crucial amounts of certain elements and tiny but useful dust particles.
It’s from this ancient and fortuitous cloud that a blazing, life-sustaining sphere was ultimately born. The ancient Romans knew it as “Sol,” which today remains the scientific name for our Sun.
What Is the Sun Made Of?
That molecular cloud contained essential amounts of hydrogen, as well as some helium. Over time, the cloud, known as a solar nebula, began to spin and collapse in on itself. Under the force of its own gravity, the nebula flattened into a disk. At the center of the disk, gravity drew in most of the gas and dust from the nebula.
Pressure became so great at the center that it fused those useful hydrogen atoms, producing more helium. Nuclear fusion also produced tremendous amounts of energy, heat, and of course light. Thus, the Sun was born.
Incidentally, so was the rest of the solar system, as other materials from the nebula formed around the Sun, sometimes colliding with each other, sometimes sticking together, ultimately coalescing into the planets and moons we know today. As for what the Sun is itself, it remains essentially one giant sphere of hydrogen and helium, constantly burning through massive amounts of hydrogen to maintain nuclear fusion and its energy output.
How Do We Know How Old the Sun Is?
While we can’t pinpoint the precise moment when it was born, our best estimate is that the Sun is about 4.6 billion years old.
Since we know that the solar system and most everything in it formed at around the same time, we’re able to determine the Sun’s age thanks to radiometric dating of the oldest rocks in the system. This includes meteorites, lunar rocks and even some of the very oldest rocks on Earth, which have all been determined to be around — surprise! — 4.6 billion years old (give or take). It’s no great leap to estimate the age of the Sun from this data.
Read More: Thousands Of Meteorites Hit Earth Each Year — Here's What They Bring
How Long Will the Sun Last?
Although 4.6 billion years sounds unimaginably ancient to us, our Sun is actually in middle age. It has loads of hydrogen left to burn and you can count on it to keep us in sunlight for a long while yet.
But how long will the sun last, exactly? Well, right now, the Sun is a main-sequence star, meaning that, like many middle-aged people, it’s in the stable part of its lifecycle. After main sequence, however, stars like ours will run out of hydrogen fuel to burn — which could occur anywhere from about 6 to 7 billion years from now. When that happens to our old friend Sol, its core will shrink, but its outer gaseous layers will get bigger — much bigger. In fact, our Sun will become a red giant. Fusion will turn its helium into heavier elements like carbon, nitrogen and oxygen. Eventually, the Sun will expand to encompass its closer, rocky planets, including Mercury, Venus and possibly Earth.
Read More: A Sun’s Eye View of the Solar System
What Will Happen When the Sun Dies?
Once it burns off all of its fuel, in about 8 billion years, all that will be left of the Sun will likely be a dense little ember known as a white dwarf. (Despite what some science fiction writers might like to imagine, the Sun is nowhere near massive enough to explode into a supernova or collapse into a black hole.) That white dwarf will be dead, and at that point only a little bigger than Earth-sized, but it will still burn hot and bright for quite a while — about another quadrillion years.
Eventually, though, even that white dwarf will dim, becoming a black dwarf at its uttermost end. Darkness will come at last to our corner of the galaxy. Well before the Sun dies, though, increased solar heat, climate change or other events could make Earth uninhabitable for humans in as little as 150 million years, possibly much sooner.
But the real end for life of almost any kind will probably occur in 1 to 2 billion years, when the Sun will have become warm enough to vaporize all water on the planet. But not to worry: One way or another, whether by extinction or (hopefully) evacuation, humanity will be long gone by then.
Read More: The Most Detailed Picture of the Sun’s Surface Yet