The biological and geological future of the Earth can be extrapolated based upon the estimated effects of several long-term influences. These include the chemistry at the Earth's surface, the rate of cooling of the planet's interior, the gravitational interactions with other objects in the Solar System, and a steady increase in the Sun's luminosity. An uncertain factor in this extrapolation is the ongoing influence of technology introduced by humans, such as geoengineering, which could cause significant changes to the planet. The current biotic crisis is being caused by technology and the effects may last for up to five million years. In turn, technology may result in the extinction of humanity, leaving the planet to gradually return to a slower evolutionary pace resulting solely from long-term natural processes.
Over time intervals of hundreds of millions of years, random celestial events pose a global risk to the biosphere, which can result in mass extinctions. These include impacts by comets or asteroids with diameters of 5–10 km (3.1–6.2 mi) or more, and the possibility of a massive stellar explosion, called a supernova, within a 100-light-year radius of the Sun, called a Near-Earth supernova. Other large-scale geological events are more predictable. If the long-term effects of global warming are disregarded, Milankovitch theory predicts that the planet will continue to undergo glacial periods at least until the quaternary glaciation comes to an end. These periods are caused by eccentricity, axial tilt, and precession of the Earth's orbit. As part of the ongoing supercontinent cycle, plate tectonics will probably result in a supercontinent in 250–350 million years. Some time in the next 1.5–4.5 billion years, the axial tilt of the Earth may begin to undergo chaotic variations, with changes in the axial tilt of up to 90°.
During the next four billion years, the luminosity of the Sun will steadily increase, resulting in a rise in the solar radiation reaching the Earth. This will cause a higher rate of weathering of silicate minerals, which will cause a decrease in the level of carbon dioxide in the atmosphere. In about 600 million years, the level of CO
2 will fall below the level needed to sustain C3 carbon fixation photosynthesis used by trees. Some plants use the C4 carbon fixation method, allowing them to persist at CO
2 concentrations as low as 10 parts per million. However, the long-term trend is for plant life to die off altogether. The extinction of plants will be the demise of almost all animal life, since plants are the base of the food chain on Earth.
In about 1.1 billion years, the solar luminosity will be 10% higher than at present. This will cause the atmosphere to become a "moist greenhouse", resulting in a runaway evaporation of the oceans. As a likely consequence, plate tectonics will come to an end. Following this event, the planet's magnetic dynamo may come to an end, causing the magnetosphere to decay and leading to an accelerated loss of volatiles from the outer atmosphere. Four billion years from now, the increase in the Earth's surface temperature will cause a runaway greenhouse effect. By that point, most if not all the life on the surface will be extinct. The most probable fate of the planet is absorption by the Sun in about 7.5 billion years, after the star has entered the red giant phase and expanded to cross the planet's current orbit.
Humans now play a key role in the biosphere, with the large human population dominating many of Earth's ecosystems. This has resulted in a widespread, ongoing extinction of other species during the present geological epoch, now known as the Holocene extinction. The large-scale loss of species caused by human influence since the 1950s has been called a biotic crisis, with an estimated 10% of the total species lost as of 2007. At current rates, about 30% of species are at risk of extinction in the next hundred years. The Holocene extinction event is the result of habitat destruction, the widespread distribution of invasive species, hunting, and climate change. In the present day, human activity has had a significant impact on the surface of the planet. More than a third of the land surface has been modified by human actions, and humans use about 20% of global primary production. The concentration of carbon dioxide in the atmosphere has increased by close to 30% since the start of the Industrial Revolution.
The consequences of a persistent biotic crisis have been predicted to last for at least five million years. It could result in a decline in biodiversity and homogenization of biotas, accompanied by a proliferation of species that are opportunistic, such as pests and weeds. Novel species may also emerge; in particular taxa that prosper in human-dominated ecosystems may rapidly diversify into many new species. Microbes are likely to benefit from the increase in nutrient-enriched environmental niches. However, no new species of existing large vertebrates are likely to arise and food chains will probably be shortened.
There are multiple scenarios for known risks that can have a global impact on the planet. From the perspective of humanity, these can be subdivided into survivable risks and terminal risks. Risks that humanity pose to itself include the misuse of nanotechnology, a nuclear holocaust, warfare with a programmed superintelligence, a genetically engineered disease, or perhaps a disaster caused by a physics experiment. Similarly, several natural events may pose a doomsday threat, including a highly virulent disease, the impact of an asteroid or comet, runaway greenhouse effect, and resource depletion. There may also be the possibility of an infestation by an extraterrestrial lifeform. The actual odds of these scenarios are difficult if not impossible to deduce.
Should the human race become extinct, then the various features assembled by humanity will begin to decay. The largest structures have an estimated decay half-life of about 1,000 years. The last surviving structures would most likely be open pit mines, large landfills, major highways, wide canal cuts, and earth-fill flank dams. A few massive stone monuments like the pyramids at the Giza Necropolis or the sculptures at Mount Rushmore may still survive in some form after a million years.
As the Sun orbits the Milky Way, randomly moving stars may approach close enough to have a disruptive influence on the Solar System. A close stellar encounter may cause a significant reduction in the perihelion distances of comets in the Oort cloud—a spherical region of icy bodies orbiting within half a light year of the Sun. Such an encounter can trigger a 40-fold increase in the number of comets reaching the inner Solar System. Impacts from these comets can trigger a mass extinction of life on Earth. These disruptive encounters occur at an average of once every 45 million years. The mean time for the Sun to collide with another star in the solar neighborhood is approximately 3 × 1013 years, which is much longer than the estimated age of the Milky Way galaxy, at 1–2 × 1010 years. This can be taken as an indication of the low likelihood of such an event occurring during the lifetime of the Earth.
The energy release from the impact of an asteroid or comet with a diameter of 5–10 km (3.1–6.2 mi) or larger is sufficient to create a global environmental disaster and cause a statistically significant increase in the number of species extinctions. Among the deleterious effects resulting from a major impact event is a cloud of fine dust ejecta blanketing the planet, which lowers land temperatures by about 15 °C (27 °F) within a week and halts photosynthesis for several months. The mean time between major impacts is estimated to be at least 100 million years. During the last 540 million years, simulations demonstrated that such an impact rate is sufficient to cause 5–6 mass extinctions and 20–30 lower severity events. This matches the geologic record of significant extinctions during the Phanerozoic Eon. Such events can be expected to continue into the future.
A supernova is a cataclysmic explosion of a star. Within the Milky Way galaxy, supernova explosions occur on average once every 40 years. During the history of the Earth, multiple such events have likely occurred within a distance of 100 light years. Explosions inside this distance can contaminate the planet with radioisotopes and possibly impact the biosphere. Gamma rays emitted by a supernova react with nitrogen in the atmosphere, producing nitrous oxides. These molecules cause a depletion of the ozone layer that protects the surface from ultraviolet radiation from the Sun. An increase in UV-B radiation of only 10–30% is sufficient to cause a significant impact to life; particularly to the phytoplankton that form the base of the oceanic food chain. A supernova explosion at a distance of 26 light years will reduce the ozone column density by half. On average, a supernova explosion occurs within 32 light years once every few hundred million years, resulting in a depletion of the ozone layer lasting several centuries. Over the next two billion years, there will be about 20 supernova explosions and one gamma ray burst that will have a significant impact on the planet's biosphere.
The incremental effect of gravitational perturbations between the planets causes the inner Solar System as a whole to behave chaotically over long time periods. This does not significantly affect the stability of the Solar System over intervals of a few millions years or less, but over billions of years the orbits of the planets become unpredictable. Computer simulations of the Solar System's evolution over the next five billion years suggest that there is a small (less than 1%) chance that a collision could occur between Earth and either Mercury, Venus, or Mars. During the same interval, the odds that the Earth will be scattered out of the Solar System by a passing star are on the order of one part in 105. In such a scenario, the oceans would freeze solid within several million years, leaving only a few pockets of liquid water about 14 km (8.7 mi) underground. There is a remote chance that the Earth will instead be captured by a passing binary star system, allowing the planet's biosphere to remain intact. The odds of this happening are about one chance in three million.
The gravitational perturbations of the other planets in the Solar System combine to modify the orbit of the Earth and the orientation of its spin axis. These changes can influence the planetary climate.
Historically, there have been cyclical ice ages in which glacial sheets periodically covered the higher latitudes of the continents. Ice ages may occur because of changes in ocean circulation and continentality induced by plate tectonics. The Milankovitch theory predicts that glacial periods occur during ice ages because of astronomical factors in combination with climate feedback mechanisms. The primary astronomical drivers are a higher than normal orbital eccentricity, a low axial tilt (or obliquity), and the alignment of summer solstice with the aphelion. Each of these effects occur cyclically. For example, the eccentricity changes over time cycles of about 100,000 and 400,000 years, with the value ranging from less than 0.01 up to 0.05. This is equivalent to a change of the semiminor axis of the planet's orbit from 99.95% of the semimajor axis to 99.88%, respectively.
The Earth is passing through an ice age known as the quaternary glaciation, and is presently in the Holocene interglacial period. This period would normally be expected to end in about 25,000 years. However, the increased rate of carbon dioxide release into the atmosphere by humans may delay the onset of the next glacial period until at least 50,000–130,000 years from now. On the other hand, a global warming period of finite duration (based on the assumption that fossil fuel use will cease by the year 2200) will probably only impact the glacial period for about 5,000 years. Thus, a brief period of global warming induced through a few centuries worth of greenhouse gas emission would only have a limited impact in the long term.
The tidal acceleration of the Moon slows the rotation rate of the Earth and increases the Earth-Moon distance. Friction effects—between the core and mantle and between the atmosphere and surface—can dissipate the Earth's rotational energy. These combined effects are expected to increase the length of the day by more than 1.5 hours over the next 250 million years, and to increase the obliquity by about a half degree. The distance to the Moon will increase by about 1.5 Earth radii during the same period.
Based on computer models, the presence of the Moon appears to stabilize the obliquity of the Earth, which may help the planet to avoid dramatic climate changes. This stability is achieved because the Moon increases the precession rate of the Earth's spin axis, thereby avoiding resonances between the precession of the spin and precession frequencies of the ascending node of the planet's orbit. (That is, the precession motion of the ecliptic.) However, as the semimajor axis of the Moon's orbit continues to increase in the future, this stabilizing effect will diminish. At some point perturbation effects will probably cause chaotic variations in the obliquity of the Earth, and the axial tilt may change by angles as high as 90° from the plane of the orbit. This is expected to occur within about 1.5–4.5 billion years, although the exact time is unknown.
A high obliquity would probably result in dramatic changes in the climate and may destroy the planet's habitability. When the axial tilt of the Earth reaches 54°, the equator will receive less radiation from the Sun than the poles. The planet could remain at an obliquity of 60° to 90° for periods as long as 10 million years.
Tectonics-based events will continue to occur well into the future and the surface will be steadily reshaped by tectonic uplift, extrusions, and erosion. Mount Vesuvius can be expected to erupt about 40 times over the next 1,000 years. During the same period, about five to seven earthquakes of magnitude 8 or greater should occur along the San Andreas Fault, while about 50 magnitude 9 events may be expected worldwide. Mauna Loa should experience about 200 eruptions over the next 1,000 years, and the Old Faithful Geyser will likely cease to operate. The Niagara Falls will continue to retreat upstream, reaching Buffalo in about 30,000–50,000 years.
In 10,000 years, the post-glacial rebound of the Baltic Sea will have reduced the depth by about 90 m (300 ft). The Hudson Bay will decrease in depth by 100 m over the same period. After 100,000 years, the island of Hawaii will have shifted about 9 km (5.6 mi) to the northwest. The planet may be entering another glacial period by this time.
The theory of plate tectonics demonstrates that the continents of the Earth are moving across the surface at the rate of a few centimeters per year. This is expected to continue, causing the plates to relocate and collide. Continental drift is facilitated by two factors: the energy generation within the planet and the presence of a hydrosphere. With the loss of either of these, continental drift will come to a halt. The production of heat through radiogenic processes is sufficient to maintain mantle convection and plate subduction for at least the next 1.1 billion years.
At present, the continents of North and South America are moving westward from Africa and Europe. Researchers have produced several scenarios about how this will continue in the future. These geodynamic models can be distinguished by the subduction flux, whereby the oceanic crust moves under a continent. In the introversion model, the younger, interior, Atlantic ocean becomes preferentially subducted and the current migration of North and South America is reversed. In the extroversion model, the older, exterior, Pacific ocean remains preferentially subducted and North and South America migrate toward eastern Asia.
As the understanding of geodynamics improves, these models will be subject to revision. In 2008, for example, a computer simulation was used to predict that a reorganization of the mantle convection will occur over the next 100 million years, causing a supercontinent composed of Africa, Eurasia, Australia, Antarctica and South America to form around Antarctica.
Regardless of the outcome of the continental migration, the continued subduction process causes water to be transported to the mantle. After a billion years from the present, a geophysical model gives an estimate that 27% of the current ocean mass will have been subducted. If this process were to continue unmodified into the future, the subduction and release would reach a point of stability after 65% of the current ocean mass has been subducted.
Christopher Scotese and his colleagues have mapped out the predicted motions several hundred million years into the future as part of the Paleomap Project. In their scenario, 50 million years from now the Mediterranean sea may vanish and the collision between Europe and Africa will create a long mountain range extending to the current location of the Persian Gulf. Australia will merge with Indonesia, and Baja California will slide northward along the coast. New subduction zones may appear off the eastern coast of North and South America, and mountain chains will form along those coastlines. To the south, the migration of Antarctica to the north will cause all of its ice sheets to melt. This, along with the melting of the Greenland ice sheets, will raise the average ocean level by 90 m (300 ft). The inland flooding of the continents will result in climate changes.
As this scenario continues, by 100 million years from the present the continental spreading will have reached its maximum extent and the continents will then begin to coalesce. In 250 million years, North America will collide with Africa while South America will wrap around the southern tip of Africa. The result will be the formation of a new supercontinent (sometimes called Pangaea Ultima), with the Pacific Ocean stretching across half the planet. The continent of Antarctica will reverse direction and return to the South Pole, building up a new ice cap.
The first scientist to extrapolate the current motions of the continents was Canadian geologist Paul F. Hoffman of Harvard University. In 1992, Hoffman predicted that the continents of North and South America would continue to advance across the Pacific Ocean, pivoting about Siberia until they begin to merge with Asia. He dubbed the resulting supercontinent, Amasia. Later, in the 1990s, Roy Livermore calculated a similar scenario. He predicted that Antarctica would start to migrate northward, and east Africa and Madagascar would move across the Indian Ocean to collide with Asia.
In an extroversion model, the closure of the Pacific Ocean would be complete in about 350 million years. This marks the completion of the current supercontinent cycle, wherein the continents split apart and then rejoin each other about every 400–500 million years. Once the supercontinent is built, plate tectonics may enter a period of inactivity as the rate of subduction drops by an order of magnitude. This period of stability could cause an increase in the mantle temperature at the rate of 30–100 K (30–100 °C) every 100 million years, which is the minimum lifetime of past supercontinents. As a consequence, volcanic activity may increase.
The formation of a supercontinent can dramatically affect the environment. The collision of plates will result in mountain building, thereby shifting weather patterns. Sea levels may fall because of increased glaciation. The rate of surface weathering can rise, resulting in an increase in the rate that organic material is buried. Supercontinents can cause a drop in global temperatures and an increase in atmospheric oxygen. This, in turn, can affect the climate, further lowering temperatures. All of these changes can result in more rapid biological evolution as new niches emerge.
The formation of a supercontinent insulates the mantle. The flow of heat will be concentrated, resulting in volcanism and the flooding of large areas with basalt. Rifts will form and the supercontinent will split up once more. The planet may then experience a warming period, as occurred during the Cretaceous period.
The iron-rich core region of the Earth is divided into a 1,220 km (760 mi) radius solid inner core and a 3,480 km (2,160 mi) radius liquid outer core. The rotation of the Earth creates convective eddies in the outer core region that cause it to function as a dynamo. This generates a magnetosphere about the Earth that deflects particles from the solar wind, which prevents significant erosion of the atmosphere from sputtering. As heat from the core is transferred outward toward the mantle, the net trend is for the inner boundary of the liquid outer core region to freeze, thereby releasing thermal energy and causing the solid inner core to grow. This iron crystallization process has been ongoing for about a billion years. In the modern era, the radius of the inner core is expanding at an average rate of roughly 0.5 mm (0.02 in) per year, at the expense of the outer core. Nearly all of the energy needed to power the dynamo is being supplied by this process of inner core formation.
The growth of the inner core may be expected to consume most of the outer core by some 3–4 billion years from now, resulting in a nearly solid core composed of iron and other heavy elements. The surviving liquid envelope will mainly consist of lighter elements that will undergo less mixing. Alternatively, if at some point plate tectonics comes to an end, the interior will cool less efficiently, which may end the growth of the inner core. In either case, this can result in the loss of the magnetic dynamo. Without a functioning dynamo, the magnetic field of the Earth will decay in a geologically short time period of roughly 10,000 years. The loss of the magnetosphere will cause an increase in erosion of light elements, particularly hydrogen, from the Earth's outer atmosphere into space, resulting in less favorable conditions for life.
The energy generation of the Sun is based upon thermonuclear fusion of hydrogen into helium. This occurs in the core region of the star using the proton–proton chain reaction process. Because there is no convection in the solar core, the helium concentration builds up in that region without being distributed throughout the star. The temperature at the core of the Sun is too low for nuclear fusion of helium atoms through the triple-alpha process, so these atoms do not contribute to the net energy generation that is needed to maintain hydrostatic equilibrium of the Sun.
At present, nearly half the hydrogen at the core has been consumed, with the remainder of the atoms consisting primarily of helium. As the number of hydrogen atoms per unit mass decrease, so too does their energy output provided through nuclear fusion. This results in a decrease in pressure support, which causes the core to contract until the increased density and temperature bring the core pressure into equilibrium with the layers above. The higher temperature causes the remaining hydrogen to undergo fusion at a more rapid rate, thereby generating the energy needed to maintain the equilibrium.
The result of this process has been a steady increase in the energy output of the Sun. When the Sun first became a main sequence star, it radiated only 70% of the current luminosity. The luminosity has increased in a nearly linear fashion to the present, rising by 1% every 110 million years. Likewise, in three billion years the Sun is expected to be 33% more luminous. The hydrogen fuel at the core will finally be exhausted in 4.8 billion years, when the Sun will be 67% more luminous than at present. Thereafter the Sun will continue to burn hydrogen in a shell surrounding its core, until the increase in luminosity reaches 121% of the present value. This marks the end of the Sun's main sequence lifetime, and thereafter it will pass through the subgiant stage and evolve into a red giant.
Once the core hydrogen is exhausted in 4.8 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. With the increased surface area of the Sun, the amount of energy emitted will increase. Unless Earth's orbital radius increases significantly, the global temperature of the Earth will climb because of the rising luminosity of the Sun. However, geoscientist James Kasting says the oceans may evaporate much earlier, in about a billion years.
The rate of weathering of silicate minerals will increase. This in turn will decrease the level of carbon dioxide in the atmosphere, as these weathering processes convert carbon dioxide into carbonate materials. Within the next 600 million years from the present, the concentration of CO
2 will fall below the critical threshold needed to sustain C3 photosynthesis: about 50 parts per million. At this point, trees and forests in their current forms will no longer be able to survive, the last living trees being evergreen conifers. However, C4 carbon fixation can continue at much lower concentrations, down to above 10 parts per million. Thus plants using C4 photosynthesis may be able to survive for at least 0.8 billion years and possibly as long as 1.2 billion years from now, after which rising temperatures will make the biosphere unsustainable. Currently, C4 plants represent about 5% of Earth's plant biomass and 1% of its known plant species. For example, about 50% of all grass species (Poaceae) use the C4 photosynthetic pathway, as do many species in the herbaceous family Amaranthaceae.
When the levels of carbon dioxide fall to the limit where photosynthesis is barely sustainable, the proportion of carbon dioxide in the atmosphere is expected to oscillate up and down. This will allow land vegetation to flourish each time the level of carbon dioxide rises due to tectonic activity and animal life. However, the long term trend is for the plant life on land to die off altogether as most of the remaining carbon in the atmosphere becomes sequestered in the Earth. Some microbes are capable of photosynthesis at concentrations of CO
2 of a few parts per million, so these life forms would probably disappear only because of rising temperatures and the loss of the biosphere.
Plants—and, by extension, animals—could survive longer by evolving other strategies such as requiring less CO
2 for photosynthetic processes, becoming carnivorous, adapting to desiccation, or associating with fungi. These adaptations are likely to appear near the beginning of the moist greenhouse (see below).
The loss of plant life will also result in the eventual loss of oxygen as well as ozone due to chemical reactions in the atmosphere and volcanic eruptions, meaning less attenuation of DNA-damaging ultraviolet radiation, as well as the death of animals; the first animals to disappear would be large mammals and fish, followed by small mammals, fish and birds, amphibians, reptiles, and finally invertebrates.
In their work The Life and Death of Planet Earth, authors Peter D. Ward and Donald Brownlee have also argued that some form of animal life may continue even after most of the Earth's plant life has disappeared. Initially, they expect that some insects, lizards, birds and small mammals may persist, along with sea life. Without oxygen replenishment by plant life, however, they believe that the animals would probably die off from asphyxiation within a few million years. Even if sufficient oxygen were to remain in the atmosphere through the persistence of some form of photosynthesis, the steady rise in global temperature would result in a gradual loss of biodiversity. As temperatures continue to rise, the last animal life will inevitably be driven back toward the poles, and possibly even underground. Much of the surface would become a barren desert and life would primarily be found in the oceans; however, due also to a decrease of the amount or organic matter coming to the oceans from the land as well as oxygen in the water, life would disappear there too following a similar path to that on Earth's surface with invertebrates being the last living animals, and of them those that do not depend on living plants such as termites or those near hydrothermal vents such as worms of the genus Riftia As a result of these processes, multi-cellular lifeforms may be extinct in about 800 million years, and eukaryotes in 1.3 billion years from now, leaving only the prokaryotes.
By one billion years from now, about 27% of the modern ocean will have been subducted into the mantle. If this process were allowed to continue uninterrupted, it would reach an equilibrium state where 65% of the current surface reservoir would remain at the surface. Once the solar luminosity is 10% higher than its current value, the average global surface temperature will rise to 320 K (47 °C). The atmosphere will become a "moist greenhouse" leading to a runaway evaporation of the oceans. At this point, models of the Earth's future environment demonstrate that the stratosphere would contain increasing levels of water. These water molecules will be broken down through photodissociation by solar ultraviolet radiation, allowing hydrogen to escape the atmosphere. The net result would be a loss of the world's sea water by about 1.1 billion years from the present.
In this ocean-free era, there will continue to be reservoirs at the surface as water is steadily released from the deep crust and mantle, where it is estimated there is an amount of water equivalent to several times that currently present in the Earth's oceans. Some water may be retained at the poles and there may be occasional rainstorms, but for the most part the planet would be a dry desert with large dunefields covering its equator, resembling how Saturn's largest moon Titan looks today. Even in these arid conditions, the planet may retain some microbial and possibly even multi-cellular life. Most of these microbes will be halophiles. However, the increasingly extreme conditions will likely lead to the extinction of the prokaryotes between 1.6 billion years and 2.8 billion years  from now, with the last of them living in residual ponds of water at high latitudes and heights or in caverns with trapped ice; underground life, however, could last longer. What happens next depends on the level of tectonic activity. A steady release of carbon dioxide by volcanic eruption could eventually cause the atmosphere to enter a "supergreenhouse" state like that of the planet Venus. But without surface water, plate tectonics would probably come to a halt and most of the carbonates would remain securely buried until the Sun became a red giant and its increased luminosity heated the rock to the point of releasing the carbon dioxide.
The loss of the oceans could be delayed until two billion years in the future if the total atmospheric pressure were to decline. A lower atmospheric pressure would reduce the greenhouse effect, thereby lowering the surface temperature. This could occur if natural processes were to remove the nitrogen from the atmosphere. Studies of organic sediments has shown that at least 100 kilopascals (0.99 atm) of nitrogen has been removed from the atmosphere over the past four billion years; enough to effectively double the current atmospheric pressure if it were to be released. This rate of removal would be sufficient to counter the effects of increasing solar luminosity for the next two billion years. However, beyond that point, unless most of Earth's surface water has been lost by that time, in which case the planet will stay in the same conditions until the starting of the red giant phase, the amount of water in the lower atmosphere will have risen to 40% and the runaway moist greenhouse will commence when the luminosity from the Sun reaches 35–40% more than its current value, 3–4 billion years from now. The atmosphere will heat up and the surface temperature will rise sufficiently to melt surface rock. However, most of the atmosphere will be retained until the Sun has entered the red giant stage.
Once the Sun changes from burning hydrogen at its core to burning hydrogen around its shell, the core will start to contract and the outer envelope will expand. The total luminosity will steadily increase over the following billion years until it reaches 2,730 times the Sun's current luminosity at the age of 12.167 billion years. During this phase the Sun will experience more rapid mass loss, with about 33% of its total mass shed with the solar wind. The loss of mass will mean that the orbits of the planets will expand. The orbital distance of the Earth will increase to at most 150% of its current value.
The most rapid part of the Sun's expansion into a red giant will occur during the final stages, when the Sun will be about 12 billion years old. It is likely to expand to swallow both Mercury and Venus, reaching a maximum radius of 1.2 AU (180,000,000 km). The Earth will interact tidally with the Sun's outer atmosphere, which would serve to decrease Earth's orbital radius. Drag from the chromosphere of the Sun would also reduce the Earth's orbit. These effects will act to counterbalance the effect of mass loss by the Sun, and the Earth will most likely be engulfed by the Sun. The ablation and vaporization caused by its fall on a decaying trajectory towards the Sun will remove Earth's crust and mantle, then finally destroy it after at most 200 years. Earth's sole legacy will be a very slight increase (0.01%) of the solar metallicity.
Before this happens, most of Earth's atmosphere will have been lost to space and its surface will consist of a magma ocean with floating continents of metals and metal oxides as well as icebergs of refractory materials, with its surface temperature reaching more than 2,400 K (2,130 °C).
The drag from the solar atmosphere may cause the orbit of the Moon to decay. Once the orbit of the Moon closes to a distance of 18,470 km (11,480 mi), it will cross the Earth's Roche limit. This means that tidal interaction with the Earth would break apart the Moon, turning it into a ring system. Most of the orbiting ring will then begin to decay, and the debris will impact the Earth. Hence, even if the Earth is not swallowed up by the Sun, the planet may be left moonless.
After fusing helium in its core to carbon, the Sun will begin to collapse again, evolving into a compact white dwarf star after ejecting its outer atmosphere as a planetary nebula. Any planets that survive this process will continue to orbit this body, but will receive little thermal radiation and become frigid bodies. Over time intervals of around every 30 trillion years, the Sun will undergo a close encounter with another star. As a consequence, the orbits of their planets can become disrupted, potentially ejecting them from the system entirely.
Should the Earth have survived these calamities, over a time of about 1020 (100 quintillion) years, the planet's orbit will steadily decay through emission of gravitational radiation, before finally being ripped apart by tidal forces at a distance of around 1-6 radii from the Sun.