The sloshing phenomenon has exceptional significance due to its occurrence in various processes as well as its application. This phenomenon occurs when a vessel is partly filled with a fluid and under the influence of external forces the free surface of the liquid moves and exchanges forces with the wall of the vessel. In this research, numerical modeling is used to study the behavior of ferrofluid in sloshing phenomenon in a rectangular container with a specified length and width of 10 cm × 5 cm respectively. The force that moves the vessel is the oscillatory motion in the x-axis direction. Applying a uniform magnetic force, which creates additional modules in the governing equations, such as the momentum equation, has effects on this phenomenon and fluid motion. The main aim of this research is to study the effects of the uniform MHD field in different directions and angles on the ferrofluid sloshing. Bystudying the results of some factors (such as; the pressure of the ferrofluid to the specific points on the vessel wall, the maximum surface at any time, and the analysis of the surface situation at different times) the impact of the magnetic field with different angles has been identified on the ferrofluid sloshing. The results showed that in the absence of an external magnetic field, the sloshing behavior of water and ferrofluid were approximately the same. Applying the MHDmagnetic field caused a 14.5%, 25% and 36% decrease in the maximum height of the fluid level at angles 0◦, 45◦ and 90◦ of magnetic field respectively. Therefore, these results indicate the influence of the magnetic field direction on the behavior of the ferrofluid sloshing.