With more and more exoplanets being detected, it is paid closer attention to whether there are lives outside solar system. We try to obtain habitable zones and the probability distribution of terrestrial planets in habitable zones around host stars. Using Eggleton’s code, we calculate the evolution of stars with masses less than 4.00 M ☉. We also use the fitting formulae of stellar luminosity and radius, the boundary flux of habitable zones, the distribution of semimajor axis and mass of planets and the initial mass function of stars. We obtain the luminosity and radius of stars with masses from 0.08 to 4.00 M ☉, and calculate the habitable zones of host stars, affected by stellar effective temperature. We achieve the probability distribution of terrestrial planets in habitable zones around host stars. We also calculate that the number of terrestrial planets in habitable zones of host stars is 45.5 billion, and the number of terrestrial planets in habitable zones around K type stars is the most, in the Milky Way.