In this work, we reinvestigate the electron fraction Ye and electron Fermi energy EF(e) of neutron stars, based on our previous work, in which we first deduce a special solution to EF(e), and then obtain several useful analytical formulae for Ye and matter density ρ within classical models and the relativistic mean‐field (RMF) theory using numerical fitting. The advantages of this formalism include the following: (a) Linear functions are substituted for the nonlinear exponential functions used in the previous work. This method may be simpler and closer to realistic equation of state (EoS) of a neutron star (NS) because there are linear or quasi‐linear relationships between number fractions of leptons and matter density, which can be seen by solving NS EoS. (b) We introduce a dimensionless variable ϱ (ϱ = ρ/ρ0, ρ0 is the standard saturated nuclear density), which greatly reduces the scope of the fitting coefficients. (c) We present numerical errors including absolute and relative deviations between the data and fit. By numerical simulations, we obtain several analytical formulae for Ye and ρ for both APR98 and RMF models. Combining these analytical formulae with the special solution, we can calculate the value of EF(e) for any given matter density. Since Ye and EF(e) are important in assessing the cooling rate of an NS and the possibility of kaon/pion condensation in the NS's interior, this formalism could be useful in the future studies on the thermal evolution of an NS.