We have computed the Galactic Habitable Zones ( GHZs ) of the Andromeda galaxy ( M31 ) based on the probability of terrestrial planet formation , which depends on the metallicity ( Z ) of the interstellar medium , and the number of stars formed per unit surface area . The GHZ was therefore obtained from a chemical evolution model ( CEM ) built to reproduce a metallicity gradient in the galactic disk , [ O/H ] ( r ) = -0.015 \pm 0.003 dex kpc ^ { -1 } \times r ( kpc ) +0.44 \pm 0.04 dex . This gradient is the most probable when intrinsic scatter is present in the observational data . The chemical evolution model predicted a higher star formation history ( SFH ) in both the halo and disk components of M31 and a less efficient inside-out galactic formation , compared to those of the Milky Way . If we assumed that Earth-like planets form with a probability law that follows the Z distribution shown by stars with detected planets and the SFH predicted by the CEM , the most probable GHZ per pc ^ { 2 } is located between 3 and 7 kpc for planets with ages between 6 and 7 Gy , approximately . But the highest number of stars with habitable planets is in a ring located between 12 and 14 kpc with mean age of \sim 7 Gy . 11 % and 6.5 % of the all formed stars in M31 may have planets capable of hosting basic and complex life , respectively .