A new and simple method is presented for the production of carbonaceous adsorbents with a controlled pore size from walnut shells. The carbonized walnut shells (char) were mixed with a solution of potassium hydroxide. The mixture was then activated thermally in the absence of air. The products formed were washed and dried in order to obtain a carbonaceous adsorbent. A systematic study of the effect of the activation temperature, activation time and KOH/char ratio on the microporosity of the final product was carried out. The prepared samples were subjected to adsorption with benzene at room temperature for characterization in accordance with the Dubinin-Radushkevich, BET and Langmuir equations and with respect to the micropore volume, pore width, adsorption energy and surface area. Probe molecules were also used in order to define the microporous structure. A higher temperature, a longer activation time and a higher KOH content increased the adsorption capacity and resulted in a widening of the pores. A milder activation favored the production of adsorbents with small micropores, accentuating the molecular sieving properties. By altering the synthesis conditions, the size of the pores in the adsorbent can be controlled in the ultramicropore (pore diameter <0.6 nm) to supermicropore (from 0.6 to 1.6 nm) range. It was possible to prepare several types of carbonaceous adsorbents with high adsorption capacities, high surface areas and a narrow pore size distribution.