A finite element algorithm has been developed to solve the electroencephalogram (EEG) forward problem. A new computationally efficient approach to calculate the stiffness matrix of second-order tetrahedral elements has been developed for second-order tetrahedral finite element models. The present algorithm has been evaluated by means of computer simulations, by comparing with analytic solutions in a multi-spheres concentric head model. The developed finite element method (FEM) algorithm has also been applied to address questions of interest in the EEG forward problem. The present simulation study indicates that the second-order FEM provides substantially enhanced numerical accuracy and computational efficiency, as compared with the first-order FEM for comparable numbers of tetrahedral elements. The anisotropic conductivity distribution of the head tissue can be taken into account in the present FEM algorithm. The effects of dipole eccentricity, size of finite elements and local mesh refinement on solution accuracy are also addressed in the present simulation study.