In the present paper we study compact stars under the background of Einstein–Maxwell space–time, where the 4-dimensional spherically symmetric space–time of class 1 along with the Karmarkar condition has been adopted. The investigations, via the set of exact solutions, show several important results, such as (i) the value of density on the surface is finite; (ii) due to the presence of the electric field, the outer surface or the crust region can be considered to be made of electron cloud; (iii) the charge increases rapidly after crossing a certain cutoff region (r/R ≈ 0.3); and (iv) the avalanche of charge has a possible interaction with the particles that are away from the center. As the stellar structure supports all the physical tests performed on it, therefore the overall observation is that the model provides a physically viable and stable compact star.