This article is investigates the effect of aligned magnetic field flow and heat transfer of carbon nanotubes over a moving extensible stretching surface through a porous medium. Definitions of thermal radiation and heat generation/absorption are utilized in the thermal expression. Carbon nanotubes (single-walled and multiwalled) and base fluids (seawater, blood, and ethylene glycol) are used to explore the impacts of heat transfer characteristics. A similarity transformation is used to transform the governing boundary layer coupled partial differential equations into a system of nonlinear ordinary differential equations, which are explored numerically using the Runge–Kutta fourth-order method along with shooting procedure. The streamlines are closer to the surface wall when there are lower values of magnetic parameter and porosity parameter. Strengthening the thermal radiation parameter value enhances the rate of heat transfer. A comparative study between the formerly published results and the present results for a special case is found to be in tremendous agreement. © 2020 by Begell House, Inc.