In this paper, we found the exact solutions of Einstein-Maxwell equations with generalized polytropic equation of state (GPEoS). For this, we consider spherically symmetric object with charged anisotropic matter distribution. We rewrite the field equations into simple form through transformation introduced by Durgapal (Phys Rev D 27:328, 1983) and solve these equations analytically. For the physically acceptability of these solutions, we plot physical quantities like energy density, anisotropy, speed of sound, tangential and radial pressure. We found that all solutions fulfill the required physical conditions. It is concluded that all our results are reduced to the case of anisotropic charged matter distribution with linear, quadratic as well as polytropic equation of state.