PurposeIn recent times, there has been a growing interest in buoyancy-induced heat transfer within confined enclosures due to its frequent occurrence in heat transfer processes across diverse engineering disciplines, including electronic cooling, solar technologies, nuclear reactor systems, heat exchangers and energy storage systems. Moreover, the reduction of entropy generation holds significant importance in engineering applications, as it contributes to enhancing thermal system performance. This study, a numerical investigation, aims to analyze entropy generation and natural convection flow in an inclined square enclosure filled with Ag–MgO/water and Ag–TiO2/water hybrid nanofluids under the influence of a magnetic field. The enclosure features heated slits along its bottom and left walls. Following the Boussinesq approximation, the convective flow arises from a horizontal temperature difference between the partially heated walls and the cold right wall.Design/methodology/approachThe governing equations for laminar unsteady natural convection flow in a Newtonian, incompressible mixture is solved using a Marker-and-Cell-based finite difference method within a customized MATLAB code. The hybrid nanofluid’s effective thermal conductivity and viscosity are determined using spherical nanoparticle correlations.FindingsThe numerical investigations cover various parameters, including nanoparticle volume concentration, Hartmann number, Rayleigh number, heat source/sink effects and inclination angle. As the Hartmann and Rayleigh numbers increase, there is a significant enhancement in entropy generation. The average Nusselt number experiences a substantial increase at extremely high values of the Rayleigh number and inclination.Practical implicationsThis numerical investigation explores advanced applications involving various combinations of influential parameters, different nanoparticles, enclosure inclinations and improved designs. The goal is to control fluid flow and enhance heat transfer rates to meet the demands of the Fourth Industrial Revolution.Originality/valueIn a 90° tilted enclosure, the addition of 5% hybrid nanoparticles to the base fluid resulted in a 17.139% increase in the heat transfer rate for Ag–MgO nanoparticles and a 16.4185% increase for Ag–TiO2 nanoparticles compared to the base fluid. It is observed that a 5% nanoparticle volume fraction results in an increased heat transfer rate, influenced by variations in both the Darcy and Rayleigh numbers. The study demonstrates that the Ag–MgO hybrid nanofluid exhibits superior heat transfer and fluid transport performance compared to the Ag–TiO2 hybrid nanofluid. The simulations pertain to the use of hybrid magnetic nanofluids in fuel cells, solar cavity receivers and the processing of electromagnetic nanomaterials in enclosed environments.