Entropy generation and heat transfer in magnetohydrodynamic two-dimensional stagnation flow of a viscous fluid over a sliding plate have been investigated. An alternative similarity transformation has been proposed for the temperature field for not to neglect the viscous dissipation and Ohmic heating terms in the energy equation. The governing equations are reduced to a set of nonlinear ordinary differential equations and solved numerically by using a new dimensionless group which represents the magnitude of dissipation. It has been observed that when the magnitude of the dissipation is high, then an increase in the external magnetic field causes the increment of the temperature and entropy generation while decrementing the heat transfer rate. In the other case, the effect of the external magnetic field is opposite. Also, it has been shown that to neglect the viscous dissipation and/or Ohmic heating terms in the energy equation may lead to errors.