To study the accuracy of numerical simulations for an AC substation grounding problem embedded in a vertical multilayered earth model, this paper proposes a novel algorithm combining the rapidly convergent one-dimensional Galerkin's BEM with higher-order basis functions on the basis of the quasi-static electric field theory. General analytical formulas for the mutual impedance between any pair of short line conductors are also derived to accelerate the numerical integration. These formulas can work in not only complex space but also real space because of our application of the quasi-static complex image method, which is different from the contribution of other earlier scientists, whose formula can work just in real space. The algorithm can be used to simulate and analyze any grounding system, including those incorporating a floating grid located anywhere in the earth model. Copyright © 2011 John Wiley & Sons, Ltd.