In this paper, CFD modeling of ferrofluid convection heat transfer in a micromixer with static magnetic field (SMF) and rotating magnetic field (RMF) is investigated. Applying a magnetic field and the existence of magnetic nanoparticles lead to the creation of transverse vortices in the micromixers by movement of nanoparticles, that improves heat transfer. There is a cylindrical pit in the microcmixer with heat source that is applied to its bottom wall. Top wall of the pit is adjacent to a fixed permanent magnet, which creates the SMF. CFD modeling first is done for heat transfer process in the micromixer in the absence of the magnetic field. Secondly, simultaneous effect of the SMF and magnetic nanoparticles on the flow pattern and heat transfer rate of ferrofluid is evaluated. Results showed that ferrofluid leads to the improvement of the heat transfer rate compared to pure water. The secondary flows induced by nanoparticles’ motion toward SMF decreases the velocity in the area of application of the magnetic field, so the heat transfer coefficient decreases. But, in the case of RMF, applying the magnetic field causes the nanoparticles to rotate inside the pit, which leads to an increase in the heat transfer coefficient. CFD results of heat transfer coefficient are compared with experimental results in a reliable reference and acceptable agreement between them is observed.