The piston is a key rotating component in the axial piston pump, and its churning losses will reduce the performance and efficiency. To improve the performance and efficiency of the axial piston pump, a computational fluid dynamics (CFD) simulation model of churning loss was established, and the effect of piston number on the churning loss was studied in detail. The simulation analysis results show that the churning losses initially increases as the number of pistons increases. However, when the number of pistons increased from 6 to 9, the torque of churning losses began to decrease due to the hydrodynamic shadowing effect. In addition, in the analysis of cavitation results, it is found that the cavitation area of the axial piston pump is mainly concentrated around the piston, and the cavitation becomes more and more serious as the speed increases. By comparing the simulation results with and without cavitation model, it can be found that the cavitation phenomenon is beneficial to the reduction of churning losses. In this paper, a piston churning losses test rig which can eliminate other friction losses is established to verify the correctness of the simulation results. The comparative analysis shows that the simulation results are consistent with the actual situation. In addition, this study also carried out a simulation study on the 7 piston pump and the 9 piston pump with the same displacement. The simulation results show that the churning losses of 7 pistons are generally greater than that of 9 pistons under the same displacement. Besides, in the case of the same piston number and displacement, reducing the pitch circle radius of piston bores is the best way to reduce churning loss. This study has certain guiding significance for the structural design and model selection of axial piston pumps.