The purpose of this study is to investigate the effects of radiation and magnetohydrodynamics on heat transfer of a nanofluid flow over a plate under constant heat flux or constant temperature. The effects of magnetohydrodynamics and radiation on the wall are assumed to be uniform and the plate is static. Momentum and energy equations are solved using the Crank–Nicholson finite difference method. In this paper, the effect of parameters such as Prandtl number, radiation parameter, magnetohydrodynamic parameter on velocity, temperature, Nusselt number and friction coefficients is investigated. The results demonstrated that an increase in magnetohydrodynamic parameter results in an increase in fluid surface penetration in the vicinity of the wall. The temperature gradient increases with the radiation parameter, leading to an increase in the fluid motion.