The galactic electron density (density of electrons in the galaxy) refers to the density of free electrons in the Milky Way interstellar medium. Overall, the ISM is presumed electrically neutral, so the free electrons are presumed to result from a slight ionization of the ISM, inevitable from the presence of a bit of short-wavelength electromagnetic radiation.
A means of estimating the density is through analysis of pulsar signals. If HI regions are identified in front of the pulsar, the analysis takes that into account. The factors revealing the electron density include the dispersion (frequency-dependent delays), and polarization.