Underground hydrogen storage is a promising solution for the safe and efficient storage of industrial-scale H2. In this study, the adsorption behaviors of H2 in coal with different ranks under various temperatures and pressures are investigated using molecular simulations. It is found that the H2 adsorption capacity is positively correlated with coal rank, which is mainly attributed to the combined effects of surface chemical property and pore structure. Moreover, the isosteric heat of adsorption of H2 increases with the reduction in pore size due to the overlap of potential energy. In addition, the absolute adsorption amount of H2 in moist coal generally decreases with the increase in moisture content because of the competitive adsorption between water and H2 and the spatial occupation of water clusters/bridges. As a result, the anthracite coal seam with abundant micropores and few hydrophilic groups is considered to have a high potential for H2 storage.