23 zettameters!
The Andromeda Galaxy is the nearest large galaxy to the Milky Way, about 2.5 million light-years from Earth. A light-year is the distance light travels in one year, about 9.46 trillion kilometers. So the light from Andromeda that reaches Earth today set out about 2.5 million years ago. From a dark site, the galaxy can be seen with the unaided eye.
The distance runs from Earth to the Andromeda Galaxy as a whole. Andromeda is itself about 220,000 light-years wide, less than a tenth of the distance between the two galaxies.
A 2021 study led by Siyang Li, which its authors called the most precise measurement of the distance to date, put Andromeda 761 kiloparsecs away, give or take 11. A kiloparsec is 1,000 parsecs, and a parsec is about 3.26 light-years. That makes the distance about 2.48 million light-years, uncertain by about 1.5%. NASA rounds it to 2.5 million.
Li's team used the Hubble Space Telescope to measure 55 Cepheid variables in Andromeda. A Cepheid is a star that brightens and dims in a steady rhythm, and the length of that rhythm shows how bright the star really is. Comparing its true brightness with how bright it looks from Earth gives its distance.
The distance is shrinking. Andromeda is moving toward the Milky Way at about 400,000 kilometers per hour, fast enough to cover the distance from Earth to the Moon in an hour. Even so, the gap closes by only about 0.015% every million years.
In the early 1900s, most astronomers thought the Milky Way was the whole universe. Andromeda was one of many faint, fuzzy patches of light called spiral nebulae, and nobody knew whether they lay inside the Milky Way or far beyond it.
In 1923, Edwin Hubble photographed Andromeda with the 100-inch Hooker telescope at Mount Wilson Observatory in California. On a photographic plate taken on the night of October 5–6, he found a star that brightened and dimmed every 31.4 days. It was a Cepheid, now known as V1. Its rhythm showed that it was about 1 million light-years away, more than three times the width that the astronomer Harlow Shapley had calculated for the Milky Way.
By the end of 1924, Hubble had found 12 Cepheids in Andromeda and estimated its distance at 900,000 light-years. The discovery showed that Andromeda is a galaxy of its own. Improved measurements have since nearly tripled Hubble's figure.
In 2012, measurements with the Hubble Space Telescope suggested that Andromeda and the Milky Way would collide in about 4 billion years and merge about 2 billion years after that. A 2025 study led by Till Sawala, using newer data from the Gaia and Hubble space telescopes, found the future less certain. It gave close to a 50% chance that the two galaxies do not merge within the next 10 billion years.