We consider the compressible isentropic Euler equations on [0, T] x T-d with a pressure law p epsilon C-1,C-gamma 1, where 1 <= gamma < 2. This includes all physically relevant cases, e.g., the monoatomic gas. We investigate under what conditions on its regularity a weak solution conserves the energy. Previous results have crucially assumed that p epsilon C-2 in the range of the density; however, for realistic pressure laws this means that we must exclude the vacuum case. Here we improve these results by giving a number of sufficient conditions for the conservation of energy, even for solutions that may exhibit vacuum: firstly, by assuming the velocity to be a divergence-measure field; secondly, imposing extra integrability on 1/rho near a vacuum; thirdly, assuming rho to be quasinearly subharmonic near a vacuum; and finally, by assuming that u and rho are Holder continuous. We then extend these results to show global energy conservation for the domain [0, T]x Omega where Omega is bounded with a C-2 boundary. We show that we can extend these results to the compressible Navier-Stokes equations, even with degenerate viscosity.