We have investigated the methods of calculating the virial coefficients in the equation of state of gases, and proposed four rules for determining the number of terms in the equation of state. These rules are: (1) Use the variation of ∑v2 (v = (pV)cal - (pV)exp); (2) each succeeding term of the polynomial should be less in numerical value than its preceding term; (3) the last term of the polynomial should be of the same order of magnitude as the experimental error; (4) the residuals v should have nearly equal numbers of positive and negative values.We advise the use of the condition A0+B0+C0+…=1, but not the condition A=RT. We have also investigated whether the expansion is better in increasing powers of pressure or of density, the omission of odd power terms, the number of significant figures in the numerical values of the virial coefficients, and the correction of some experimental data.Based on the above considerations we have recalculated the virial coefficients of hydrogen gas from two different sets of experimental data, with results differing from those of the original authors. The virial coefficients calculated from two different sources agree within twice the standard error, and differ less than those of the original authors.