In this work the ability of carbon nanotubes (CNTs) in adsorption of cephalexin antibiotics at the trace level from aqueous solution has been tested. Samples were strongly adsorbed by CNTs and satisfying recovery was obtained. Analyses of samples were carried out by help of high performance liquid chromatography. To find out the retention capabilities of cephalexin on CNTs, constant amount of each analyte was added to different volumes up to 100 ml and removed by sorbent. Comparing studies between carbon nanotube and silica gel showed higher efficiency of CNTs to silica gel in extracting of cephalexin. The preconcentration of ceph alexin on CNTs followed by high performance liquid chromatography allows the detection of 0.15–0.2 μg/ml of cephalosporins. Recoveries of spiked sample analysis in optimum situation ranged from 95.2% to 97.6%.