The invention relates to a method for quickly measuring the allantoin content in yam with near infrared spectrum, and the method can effectively solve the problems of fast measure of the allantoin content in the yam and improved productivity effect. The method includes the steps that: firstly, a straightening mould is built, a yam sample is collected to be used as a sample collection, a near infrared spectrogram for straightening the sample collection is obtained through scanning, the obtained spectroscopic data are performed pretreatment of spectrum, then the analysis result of a routine analysis-high performance liquid chromatography is adopted as a reference value, a least square method in the stoichiometry is applied to build the straightening mould between a yam medicinal herb spectrum and the allantoin content inside therein, the allantoin content in the yam is obtained through the measure of the straightening mould, the input of the spectroscopic data is realized by a computer and the soft thereof, the whole process has short time, fast speed and nicety, measures on line, improves the productive effect and saves a large number of manpower and material resources, is an innovation for measuring the allantoin content in the yam, and has huge economic and social benefit.