CO2 is a potential fluid for absorbing and accumulating thermal energy; an accurate and fast calculation method for the heat capacity is essential for the study of the flow state near the critical point. However, the calculation of the heat capacity near the critical point by the equations suggested by NIST can easily be divergent, such as for CO2, nitrogen, methane, etc. Therefore, an explicit fitting equation was studied. The fitting equation, which used density and temperature as variables and contained three constants, was derived from the nature of heat capacity change (molecular kinetic energy and potential energy). Based on the heat capacity data of the NIST WebBook, the heat capacity of CO2 is taken as the example for the equation deduction and parameter fitting. The three constants were defined in order by Origin fitting software. By this new approach, it is found that the heat capacity at the critical point is below 1% deviant from that of the NIST WebBook. Moreover, the heat capacities that are difficult to be calculated in the NIST WebBook are well calculated. The study shows that the fitting equation is efficient for the prediction of heat capacity of gases near the critical point.