# How to calculate the number density of electrons?

I am trying to calculate the number density of electrons (number of electrons/m^3) for a white dwarf, knowing these parameters :

• the mass and radius of the white dwarf (therefore its density (kg/m^3))
• the electronic fraction : fe = 0.5

I am a bit struggling with the latter notion and with the role it plays in the formula we are trying to establish.

Can somebody give me an easy way to link all these parameters to get the number density of electrons?

(I tried many approaches but none of them was convincing. By searching the web, I found a formula using the mass of the proton, which I did not really understand.)

And half the mass is in the form of protons (the other half is neutrons) This is given by the electronic fraction. If the density of the matter is $$\rho$$, the density of protons' mass is $$0.5\rho$$ kg/m³.
So if the mass of proton is 1.67e-27 kg, then the number of protons per cubic metre which is $$0.5\rho/(1.67\times 10^{-27})$$ and the number of electrons is the same.