Storage is the main problem to use hydrogen as a fuel in the car industry. Porous carbons are promising storage materials. We have performed computer simulations to investigate carbide-derived porous carbons, showing that these materials exhibit a structure of connected pores with graphitic walls. We then apply a thermodynamic model to evaluate the hydrogen storage. The model accounts for the quantum effects of the motion of the molecules in the pores. The pore widths optimizing the storage depend on pore shape, temperature, and pressure. At 300 K and 10 MPa, the optimal widths lie in the range 6–10 Å. The predictions are consistent with experiment. The calculated storage capacities fall below the targets proposed by the U.S. Department of Energy. This is a consequence of the weak interaction between hydrogen and the pore walls. Metallic doping enhances the binding energy of hydrogen to the walls, which has promising consequences for hydrogen storage.