Nitrogen functional groups were incorporated in ordered mesoporous carbons, and their influence on hydrogen storage was investigated. Two experimental methods were used to dope nitrogen atoms onto and/or into the organic adsorbent. First, a surface treatment using ammonia enabled doping up to 3.9 mass % of nitrogen while preserving a high surface area above 1300 m2·g−1. Second, carbon nitrides were synthesized using the hard template method and the reaction of carbon tetrachloride and ethylenediamine. In the latter instance, high contents, around 20 mass %, of nitrogen were obtained whereas the specific surface areas reached 630 m2·g−1. These materials were fully characterized by nitrogen and carbon dioxide adsorption, X-ray diffraction, X- ray photoelectron spectroscopy, and temperature-programmed desorption. Hydrogen storage in nitrogen-enriched mesoporous carbons was then studied. On one hand, physical adsorption under a wide panel of conditions (temperature, from 77 to 373 K, and pressure) shows that the texture of the adsorbent dominates the storage capability. On the other hand, electrochemical hydrogen storage enables one to store more than 0.5 wt % of hydrogen at ambient pressure and temperature. The nitrogen surface groups are involved in the electrochemical adsorption process, and an irreversible oxidation of these groups may prevent further hydrogen storage.