In this work a new family of relativistic models of electrically charged compact star has been obtained by solving Einstein–Maxwell field equations with preferred form of one of the metric potentials and a suitable form of electric charge distribution function. The resulting equation of state (EOS) has been calculated. The relativistic stellar structure for matter distribution obtained in this work may reasonably models an electrically charged compact star whose energy density associated with the electric fields is on the same order of magnitude as the energy density of fluid matter itself (e.g. electrically charged bare strange stars). Based on the analytic model developed in the present work, the values of the relevant physical quantities have been calculated by assuming the estimated masses and radii of some well known strange star candidates like X-ray pulsar Her X-1, millisecond X-ray pulsar SAX J 1808.4-3658, and 4U 1820-30.