An hp-adaptive finite element method was introduced to the computation of spontaneous potential.The hp-adaptive strategy was based on projection-based interpolation of the reference solution which approached the true solution,and was used to solve for the vector potential equation in the two-dimensional axisymmetric media.The influences of the radius of the borehole,the mud-filtrate,the resistivity in goal formation,the thickness of the goal formation,the diameter of the invasion zone,as well as the resistivity of the invasion zone on the spontaneous potential in three-layer model were analyzed.The spontaneous potential was calculated in a complicated environment in which five-layer formation and two-layer sources were present.Numerical results show that the hp-adaptive finite element method can achieve higher accuracy level with less number of degrees of freedom,and provide better computation accuracy and efficiency than any other numerical method.