This paper deals with the effect of magnetic fields (Br, Bθ, Bz) applied in r‐, θ‐, z‐directions, respectively, on entropy production and heat transfer and in a horizontal cylinder filled with an Al2O3‐water nanofluid. The results are verified using literature data. For different Richardson, Ri, and Hartmann numbers, Ha, the nanoparticles (NP) ϕ, and magnetic field orientation combined effect provide a better understanding of heat transfer and entropy optimization. The results indicate that entropy production and heat transfer and rates depend on magnetic field intensity and direction. Also, increasing Ri and NP increases entropy generation and heat transfer. Finally, applying a radial magnetic field promotes a better convective heat transfer and minimizes entropy production.