In the present research, an analytical method is applied to determine the bearing capacity of strip footing on two layers of the soil. Bearing capacity of the footing is calculated according to soil resistance beneath the foundation and virtual retaining wall method. In the said method, the active and passive force on the retaining wall are considered equal on the edge in order to determine the bearing capacity of the footing. Regarding two layers of soil, the active and passive forces of each layer is found and their resultant is applied to calculate footing bearing capacity. This method has many advantages including the possibility to determine the depth of rupture surface of the soil beneath the footing, and to study the effect of the soil second layer on footing bearing capacity. Moreover, the effect of soil improvement beneath the footing as well as the depth and width of compacted area on bearing capacity of footing are also studied here in this research. In general, the studied parameters in this project consist of soil layers thickness, soil cohesion and friction angle, footing depth and width, the width of compacted soil beneath the footing, and the depth of underground water. By programming in MATLAB, the calculation and deduction was fulfilled. The results were compared with the bearing capacity of the footing on one layer of the soil in various situations in order to study the effect of various parameters in two layers of the soil. Finally, this bearing capacity of the footing was compared with the previous experimental methods and reliable results were obtained.