We obtain a new anisotropic solution for spherically symmetric spacetimes by analyzing the Karmarkar embedding condition. For this purpose we construct a suitable form of one of the gravitational potentials to obtain a closed form solution. This form of the remaining gravitational potential allows us to solve the embedding equation and integrate the field equations. The resulting new anisotropic solution is well behaved, which can be utilized to construct realistic static fluid spheres. Also we estimated the masses and radii of fluid spheres for LMC X-4, EXO 1785-248, PSR J1903+327 and