Adsorption is an efficient treatment process to remove benzoic acid from aqueous solution. In this study, nitrogen-containing surface groups were introduced onto activated carbon (AC) surface by modification with ammonium hydroxide, ammonium carbonate, melamine or urea. The nitrogen-containing AC samples were characterized using N2 adsorption-desorption, Boehm titration, determination of the pH of the point of zero charge (pHpzc) and X-ray photoelectron spectroscopy. The adsorption of benzoic acid from aqueous solution by nitrogen-containing AC has been studied. The Langmuir model fitted the experimental data of equilibrium isotherms better than the Freundlich model. At initial solution pH 2.1, the adsorption capacity was closely related with the amount of pyridinic and pyrrolic N on the AC surface, which indicated these two nitrogen-containing groups played an important part in the adsorption process. The enhancement of adsorption capacity was due to the strengthened π–π dispersion force between benzoic acid and the AC basal plane. Since the surface charge of AC as well as the existence form of benzoic acid varied with solution pH value, the adsorption capacity was found to be highest at pH 3.8 and dropped sharply at higher or lower pH values.