The strength of natural soft soil is low, so there is a problem of stability when the foundation pit is excavated directly in soft soil, and the replacement of dynamic compaction can improve the strength of soft soil. Through numerical simulation, the effect of dynamic replacement on the horizontal displacement of soft soil foundation pit is studied. The results show that the maximum horizontal displacement of slope is located at 1/2 of the excavation depth of slope surface rather than the top Angle, and the internal horizontal displacement of slope body decreases in a divergent gradient from the maximum displacement of slope surface to the slope body. After dynamic compaction displacement treatment of soft soil, the horizontal displacement in the excavation process can be reduced. The research results of this paper can provide reference for the design and construction of foundation pit engineering in areas with wide distribution of soft soil and large thickness.