A novel nanoporous activated carbon (NAC), based on organic xerogel compounds, was prepared at 650 degrees C pyrolysis temperature by sol-gel method from pyrogallol and formaldehyde (PF-650) mixtures in water using perchloric acid as catalyst. The performance of NAC was characterized by scanning electron microscopy, transmission electron microscopy, X-ray diffraction, and nitrogen porosimetry. The metal uptake characteristics were explored using well-established and effective parameters including pH, contact time, initial metal ion concentration, and temperature. Optimum adsorptions of Co2+ and Cd2+ were observed at pH 6.0 and 7.0, respectively. Langmuir model gave a better fit than the other models, and kinetic studies revealed that the adsorption is fast and its data are well fitted by the pseudo-second-order kinetic model and thermodynamic properties, i.e. G degrees, H degrees, and S degrees, showed that adsorption of Co2+ and Cd2+ onto NAC was endothermic, spontaneous, and feasible in the temperature range of 300-328K.