In this article, the numerical analysis has been carried out to optimize heat transfer and pressure drop in the horizontal channel in the presence of a rectangular baffle and constant temperature in two-dimension. For this aim, the governing differential equation has been solved by computational fluid dynamics software. The Reynolds numbers are in the range of 2,000 < Re < 10,000 and the working fluid is water. While the periodic boundary condition has been applied at the inlet, outlet, and the channel wall, axisymmetric boundary condition has been used for channel axis. For modeling and optimizing the turbulence, k–ω SST model and genetic algorithm have been applied, respectively. The results illustrate that adding a rectangular baffle to the channel enhances heat transfer and pressure drop. Hence, the heat transfer performance factor along with maximum heat transfer and minimum pressure drop has been investigated and the effective geometrical parameters have been introduced. As can be seen, there is an inverse relationship between baffle step and both heat transfer and pressure drop so that for p/d equal to 0.5, 1, and 1.25, the percentage of increase in Nusselt number is 141, 124, and 120% comparing to a simple channel and the increase in friction factor is 5.5, 5, and 4.25 times, respectively. The results of modeling confirm the increase in heat transfer performance and friction factor in the baffle with more height. For instance, when the Reynolds number and height are 5,000 and 3 mm, the Nusselt number and friction factor have been increased by 35% and 2.5 times, respectively. However, for baffle with 4 mm height, the increase in the Nusselt number and friction factor is 68% and 5.57 times, respectively. It is also demonstrated that by increasing Reynolds number, the maximum heat transfer performance has been decreased which is proportional to the increase in p/d and h/d. Moreover, the maximum heat transfer performance in 2,000 Reynolds number is 1.5 proportional to p/d of 0.61 and h/d of 0.36, while for 10,000 Reynolds number, its value is 1.19 in high p/d of 0.93 and h/d of 0.15. The approaches of the present study can be used for optimizing heat transfer performance where geometrical dimensions are not accessible or the rectangular baffle has been applied for heat transfer enhancement.