This paper describes an electroanalytical method for the determination of rapamycin using a pretreated pencil graphite electrode (P‐PGE) by differential pulse voltammetry. The electrodes were successfully characterized by cyclic voltammetry, electrochemical impedance spectroscopy, scanning electron microscopy, and Fourier transform infrared. The influences of instrumental and chemical parameters were investigated and optimized for the determination of rapamycin. Oxidation peak current obtained for rapamycin at P‐PGE was 10.5 times higher than that obtained for PGE. In pH = 3.0 H3PO4, a well‐defined irreversible anodic peak occurred at 1.07 V, which was attributed to the electro‐oxidation of rapamycin at P‐PGE. Under optimized conditions, the oxidation peak current of rapamycin was linear with its concentration in the range of 0.01–250 μmol/L, and the detection limit was 0.0075 μmol/L (S/N = 3). Also, the P‐PGE exhibited good reproducibility (relative SD [RSD] = 2.17% for 10 electrodes at different times using the same procedure), repeatability (RSD = 2.09% for 10 measurements with same electrode), and stability (95.80% for 10 days). The P‐PGE was simple to prepare and the method was successfully applied for the determination of rapamycin in spiked and real samples. In addition, for comparison, high‐performance liquid chromatographic method with ultraviolet (UV) detector was used for the determination of rapamycin.