A scheme for localizing the epileptic focus is proposed. The scheme is on the basis of a model with an electric dipole inside a four-layer inhomogeneous spherical model of head and utilizes a nonlinear programming algorithm applying the gradient projection method. Various initial estimates are used to prove the stability of the implemented dipole model. Fourteen single spike data and the averaged spike data are used to localize the epileptic focus. The results of the usage of the averaged spike data show that the dipole position is compatible with visual inspection of experienced clinical physicians. The results of the usage of the single spike show that 11 of the 14 single spikes have dipole locations near the result of the averaged spike but the estimated dipole moments differ markedly from one another. The localization results of the other three single spikes show that the dipole position is strongly affected by the background EEG. This kind of interference generally causes the eccentricity of the dipole to deviate from its anatomically meaningful value. According to our results, the electric dipole model is concluded to be valuable for the clinical application of localizing epileptic foci.