Although various analytical and numerical methods have been proposed by researchers to solve equations, but use of numerical tools with low volume calculations and high accuracy instead of other numerical methods with high volume calculations is inevitable in the analysis of engineering equations. In this paper, B-Spline spectral method was used to study buckling equations of the piles. Results were compared with the calculated amounts of the exact solution and finite element method. Uniform horizontal reaction coefficient has been used in most of proposed methods for analyzing buckling of the pile on elastic base. In reality, soil horizontal reaction coefficient is nonlinear along the pile. So, in this research by using B-Spline method, buckling equation of the pile with nonlinear horizontal reaction coefficient of the soil was investigated. It is worth mentioning that B-Spline method had not been used for buckling of the pile.