The invention relates to a method for extracting cordycepin. The method includes the following steps of subjecting a cordycepin fermentation liquid to reduced pressure concentration, then performing ultrasonic extraction in combinations of microwaves and light waves respectively, and further subjecting an obtained extraction liquid to separation and purification to obtain the cordycepin. Compared with traditional extraction methods, the method has the advantages that by means of the method, the extraction ratio is improved, extraction time is saved, and purity is increased.