This study investigated the effects of the aspect ratio of the cavity for average fluid temperature at exit port, average Nusselt number, maximum temperature of the fluid in the domain, drag coefficient, isotherms and streamlines on behalf of different Hartmann numbers and Rayleigh numbers. Solution of governing equations of momentum and energy has been made by finite element technique. Above mentioned parameters such as an aspect ratio which is cavity height to cavity length change from Ar = 0.5 to 2 for different Rayleigh numbers and Hartmann numbers which change from Ra = 10 3 to 10 5 and Ha = 0 to 50 respectively. Prandtl number Pr = 7 and Reynolds number Re = 100 is fixed in this simulation. It is found that variation of the aspect ratio makes an important effect for higher values of Rayleigh numbers. Heat transfer enhances with increasing of aspect ratio. Increasing of Hartmann number decreases the heat transfer inside the cavity.