This paper presents a new family of interior solutions of Einstein–Maxwell field equations in general relativity for a static spherically symmetric distribution of a charged perfect fluid with a particular form of charge distribution. This solution gives us wide range of parameter, K, for which the solution is well behaved hence, suitable for modeling of superdense star. For this solution the gravitational mass of a star is maximized with all degree of suitability by assuming the surface density equal to normal nuclear density, ρ nm=2.5×1017 kg m−3. By this model we obtain the mass of the Crab pulsar, M Crab, 1.36M ⊙ and radius 13.21 km, constraining the moment of inertia > 1.61×1038 kg m2 for the conservative estimate of Crab nebula mass 2M ⊙. And M Crab=1.96M ⊙ with radius R Crab=14.38 km constraining the moment of inertia > 3.04×1038 kg m2 for the newest estimate of Crab nebula mass, 4.6M ⊙. These results are quite well in agreement with the possible values of mass and radius of Crab pulsar. Besides this, our model yields moments of inertia for PSR J0737-3039A and PSR J0737-3039B, I A =1.4285×1038 kg m2 and I B =1.3647×1038 kg m2 respectively. It has been observed that under well behaved conditions this class of solutions gives us the overall maximum gravitational mass of super dense object, M G(max)=4.7487M ⊙ with radius $R_{M_{\max}}=15.24~\mathrm{km}$ , surface redshift 0.9878, charge 7.47×1020 C, and central density 4.31ρ nm.