Pure rotational Raman-scattering spectra have been measured in fluid and solid hydrogen at room temperature and at pressures from 0.3 to 20 GPa. The frequency position of the four molecular rotational lines S 0 (0), S 0 (1), S 0 (2), S 0 (3) has been determined as a function of pressure. The analysis of these data has permitted the extraction of the density dependence of the hydrogen internuclear distance. In the fluid phase, this quantity shows a marked decrease in the density range from 50 mol/l to the freezing transition, with a negative curvature. In the solid phase the slope changes markedly, becoming less negative, while the curvature becomes slightly positive.