According to Beatles singer-songwriter George Harrison, all things must pass, and according to decades of mathematical and astronomical models, these things include the sun.

So, when is the sun expected to burn out?

Though the ultimate death of our medium-size solar mass is trillions of years in the future, the sun’s “life” in its current phase, known as its “main sequence” — in which the nuclear fusion of hydrogen allows it to radiate energy and provide enough pressure to keep the star from collapsing under its own mass — will end about 5 billion years from now.

“The sun is a little less than 5 billion years old,” said Paola Testa, an astrophysicist at the Center for Astrophysics, a collaboration between the Smithsonian Astrophysical Observatory and Harvard College Observatory. “It’s a kind of middle-age star, in the sense that its life is going to be of the order of 10 billion years or so.”

After the sun has burned through most of the hydrogen in its core, it will transition to its next phase as a red giant. At this point roughly 5 billion years in the future, the sun will stop generating heat via nuclear fusion, and its core will become unstable and contract, according to NASA. Meanwhile, the outer part of the sun, which will still contain hydrogen, will expand, glowing red as it cools. This expansion will gradually swallow the sun’s neighboring planets, Mercury and Venus, and ratchet up the sun’s solar winds to the point that they quash Earth’s magnetic field and strip off its atmosphere.