ABSTRACT We present the results of an analysis of the physical conditions (number density, intensity of UV field, kinetic temperature) in the cold H2-bearing interstellar medium of local and high-redshift galaxies. Our measurements are based on the fit to the observed population of H2 rotational levels and C i fine-structure levels with the help of grids of numerical models calculated with the photon-dominated region (PDR) Meudon code. A joint analysis of low H2 rotational levels and C i fine-structure levels breaks the degeneracy in the IUV−nH plane and provides significantly tighter constraints on the number density and intensity of the UV field. Using archive data from the VLT/UVES, KECK/HIRES, HST/STIS and FUSE telescopes, we selected 12 high-redshift damped Lyα systems (DLAs) in quasar spectra and 14 H2 absorption systems along the lines of sight towards stars in the Milky Way and the Magellanic Cloud galaxies. These systems have strong H2 components, with a column density log N(H2)/[cm−2] > 18 and associated C i absorptions. We find that H2-bearing media in high-redshift DLAs and in local galaxies have similar values of the kinetic temperatures Tkin ∼ 100 K and number density 10−500 cm−3. However, the intensity of incident UV radiation in DLAs varies in a wide range (0.1−100 units of the Mathis field), while it is ∼0.1−3 units of the Mathis field for H2 systems in the Milky Way and Large and Small Magellanic Cloud galaxies. The large dispersion of measured UV flux in DLAs is probably a consequence of the fact that the DLA sample probes galaxies selected from the overall galaxy population at high redshift, and therefore corresponds to a wide range of physical conditions.