The Andromeda Galaxy (/ænˈdrɒmᵻdə/), also known as Messier 31, M31, or NGC 224, is a spiral galaxy approximately 780 kiloparsecs (2.5 million light-years) from Earth. It is the nearest major galaxy to the Milky Way and was often referred to as the Great Andromeda Nebula in older texts. It received its name from the area of the sky in which it appears, the constellation of Andromeda, which was named after the mythological princess Andromeda. Being approximately 220,000 light years across, it is the largest galaxy of the Local Group, which also contains the Milky Way, the Triangulum Galaxy, and about 44 other smaller galaxies.
Despite earlier findings that suggested that the Milky Way contains more dark matter and could be the largest in the grouping, the 2006 observations by the Spitzer Space Telescope revealed that Andromeda contains one trillion (1012) stars: at least twice the number of stars in the Milky Way, which is estimated to be 200–400 billion.
The Andromeda Galaxy is estimated to be 1.5×1012 solar masses, while the mass of the Milky Way is estimated to be 8.5×1011 solar masses. In comparison, a 2009 study estimated that the Milky Way and M31 are about equal in mass, while a 2006 study put the mass of the Milky Way at ~80% of the mass of the Andromeda Galaxy. The Milky Way and Andromeda are expected to collide in 3.75 billion years, eventually merging to form a giant elliptical galaxy  or perhaps a large disc galaxy.
The apparent magnitude of the Andromeda Galaxy, at 3.4, is one of the brightest of any of the Messier objects, making it visible to the naked eye on moonless nights even when viewed from areas with moderate light pollution. Although it appears more than six times as wide as the full moon when photographed through a larger telescope, only the brighter central region is visible to the naked eye or when viewed using binoculars or a small telescope, making it appear similar to a star.