The Andromeda Galaxy (M31, or NGC 224) is the closest spiral galaxy to the Milky Way Galaxy, located approximately 2,500,000 light years from the Alpha Quadrant at its closest point.
A picture of the Andromeda Galaxy was on display in the briefing room of the USS Enterprise when the crew was reviewing star charts to search for the origin of an unknown buoy. (TOS: "The Corbomite Maneuver")
An image of the galaxy was on display on one of the large bridge monitors aboard the USS Enterprise. (TOS: "Charlie X", "The Naked Time", "The Galileo Seven", "Dagger of the Mind")
An ancient humanoid race from the Andromeda Galaxy became extinct following the destruction of their homeworld when their sun went supernova. Remnants of the species survived for a time on scattered outposts but eventually died out, leaving their android populations on their own. One of these android-populated outposts was the planet Mudd in the Milky Way Galaxy. (TOS: "I, Mudd")
Centuries ago, Kelvans became aware of dangerously rising radiation levels in Andromeda, a development expected to make that galaxy uninhabitable for their species within 10,000 years. The Kelvan Empire has dispatched expeditions of multi-generational starships to explore the neighboring galaxies for territories suitable for conquest and occupation. (TOS: "By Any Other Name")
Hypothetically, a Constitution-class starship running at maximum warp would take thousands of years to complete the journey to Andromeda. (TOS: "By Any Other Name")
The Andromeda Galaxy ( also known as Messier 31, M31, or NGC 224; often referred to as the Great Andromeda Nebula in older texts) is a spiral galaxy approximately 2.5 million light-years away in the constellation Andromeda. It is the nearest spiral galaxy to our own, the Milky Way. As it is visible as a faint smudge on a moonless night, it is one of the farthest objects visible to the naked eye, and can be seen with binoculars even in urban areas.
Andromeda is the largest galaxy of the Local Group, which consists of the Andromeda Galaxy, the Milky Way Galaxy, the Triangulum Galaxy, and about 30 other smaller galaxies. Although the largest, it may not be the most massive, as recent findings suggest that the Milky Way contains more dark matter and may be the most massive in the grouping. However, recent observations by the Spitzer Space Telescope revealed that M31 contains one trillion (1012) stars, greatly exceeding the number of stars in our own galaxy. 2006 estimates put the mass of the Milky Way to be ~80% of the mass of Andromeda, which is estimated to be 7.1×1011 solar masses.
At an apparent magnitude of 4.4, the Andromeda Galaxy is notable for being one of the brightest Messier objects, making it easily visible to the naked eye even when viewed from areas with moderate light pollution. It appears quite small without a telescope because only the central part is bright enough to be visible, but the full angular diameter of the galaxy is seven times that of the full moon.