In this research, a numerical simulation is performed to investigate thermal and viscous irreversibilities for Al2O3–water nanofluid inside a duct equipped with porous baffles. The effects of different parameters including Reynolds number, Darcy number, solid volume fraction of nanoparticles, and the number of baffle were investigated on thermal and viscous entropy generation rates and Bejan number. The results indicated that the viscous and thermal entropy generations decrease by increasing the number of baffles for N > 4. The reductions in the viscous and thermal entropy generations are 32 and 14%, respectively as the number of baffles increases in the range of 4–16. Moreover, the thermal entropy generation is dominant term in most part of the duct except along the centerline of the duct in the space between bottom and top baffles where the velocity gradients are intense.