Due to the complexity of pile–soil interaction, there is little research on active–passive piles that bear the pile-top load transmitted from the superstructure and the pile shaft load caused by the lateral soil movement around the pile simultaneously. The purpose of this study is to analyze the displacement and internal force of active–passive piles. Most of the pile design codes in China use the elastic resistance method to describe the relationship between the lateral soil resistance and the horizontal displacement of the pile, but this is not accurate enough to analyze the internal force and deformation of the pile when the pile displacement is large. For this case, the passive load on the pile shaft caused by the adjacent surcharge load can be described in stages, and the p–y curve method can be used to express the relationship between the lateral soil resistance and the horizontal displacement of the pile. Additionally, taking both the active load (vertical force, horizontal force, and bending moment on the pile top) and the passive load into account, the deflection differential equation of the pile shaft is herein established, and a corresponding finite difference method program is implemented to obtain the calculations pursuant to the equation. The correctness of the analysis method and program was verified by two test cases. The results show that our calculation method can effectively judge the flow state of the soil around piles and accurately reflect the nonlinear characteristics of pile-soil interaction. Moreover, the influence depth of the pile displacement under the passive pile condition caused by the adjacent load is significantly greater than that under active pile condition, and the maximum pile-bending moment appears near the interface of soft and hard soil layer.