stylistic:tone, information:highlighting, stylistic:style_transfer, structural:expansion, structural:reformatting
Mass estimates

Until 2018, mass estimates for the Andromeda Galaxy's halo (including dark matter) gave a value of approximately 1.5 × 10 M, compared to 8 × 10 M for the Milky Way. This contradicted even earlier measurements that seemed to indicate that the Andromeda Galaxy and Milky Way are almost equal in mass. In 2018, the earlier measurements for equality of mass were re-established by radio results as approximately 8 × 10 M. In 2006, the Andromeda Galaxy's spheroid was determined to have a higher stellar density than that of the Milky Way, and its galactic stellar disk was estimated at twice the diameter of that of the Milky Way. The total mass of the Andromeda Galaxy is estimated to be between 8 × 10 M and 1.1 × 10 M. The stellar mass of M31 is 10–15 × 10 M, with 30% of that mass in the central bulge, 56% in the disk, and the remaining 14% in the stellar halo. The radio results (similar mass to the Milky Way Galaxy) should be taken as likeliest as of 2018, although clearly, this matter is still under active investigation by several research groups worldwide.

As of 2019, current calculations based on escape velocity and dynamical mass measurements put the Andromeda Galaxy at 0.8 × 10 M, which is only half of the Milky Way's newer mass, calculated in 2019 at 1.5 × 10 M.

In addition to stars, the Andromeda Galaxy's interstellar medium contains at least 7.2 × 10 M in the form of neutral hydrogen, at least 3.4 × 10 M as molecular hydrogen (within its innermost 10 kiloparsecs), and 5.4 × 10 M of dust.

The Andromeda Galaxy is surrounded by a massive halo of hot gas that is estimated to contain half the mass of the stars in the galaxy. The nearly invisible halo stretches about a million light-years from its host galaxy, halfway to our Milky Way Galaxy. Simulations of galaxies indicate the halo formed at the same time as the Andromeda Galaxy. The halo is enriched in elements heavier than hydrogen and helium, formed from supernovae, and its properties are those expected for a galaxy that lies in the "green valley" of the Galaxy color-magnitude diagram (see below). Supernovae erupt in the Andromeda Galaxy's star-filled disk and eject these heavier elements into space. Over the Andromeda Galaxy's lifetime, nearly half of the heavy elements made by its stars have been ejected far beyond the galaxy's 200,000-light-year-diameter stellar disk.