The observable universe contains an estimated 6.8 x 10^24, or 6.8 septillion, stars. To reach this estimate, astronomers conducted an exhaustive inventory of the stars in the Milky Way galaxy, made reasonable inferences regarding the stars that cannot be seen from Earth and applied that model to the other galaxies within the universal horizon.
The Milky Way is a barred-spiral galaxy, similar to many that can be observed nearby, that is approximately 120,000 light-years across. Within that volume, the galaxy contains as many as 4 x 10^11, or 400 billion, stars. The observable universe reaches out to a distance of 13.8 billion light-years on every side and contains an additional 1.7 x 10^11, or 170 billion, galaxies of various sizes. The average galaxy size is similar to that of the Milky Way, which means the total population of stars in the part of the universe that may be seen from Earth is (1.7 x 10^11) x (4 x 10^11), or 6.8 septillion stars.
It is not known how far the universe extends beyond the cosmic horizon. Space-time is nearly flat, which means the universe might extend beyond the ability of observers on Earth to perceive for an infinite distance. If this is the case, the number of stars in the entire cosmos might be infinite.