The invention discloses a method for detecting illegal cooking oil and relates to the method for detecting fat. The method comprises the steps of: sampling, weighing a liquid oil sample to be measured, dissolving the liquid oil sample by a deuterated solvent, transferring the solution to a nuclear magnetic tube, and collecting hydrogen spectrum and carbon spectrum data of the sample through a high-field nuclear magnetic resonance spectrometer; analyzing data, leading out a nuclear magnetic spectrogram, judging normal edible oil and drainage oil by comparison of a specific fingerprint area, and refining the illegal oil just the same as the fingerprint area; distinguishing by concrete fatty acid constituents, carrying out aggregate analysis on concrete data of total hydrogen quantity of saturated fatty acids, concrete content of various fatty acids, relative content of oxide and relative content of free acid in different edible oil obtained by data analysis, analyzing the spectrogram by a stoichiometry method to obtain a result, collecting the spectrogram of an oil product by NMR (nuclear magnetic resonance), and then comprehensively distinguishing the illegal cooking oil according to each constituent in the oil product by a plurality of indexes.