The invention discloses a method for extracting ceramide from pineapples and application, and relates to the technical field of biological active substance preparation and application. The method comprises the steps that pineapple leaves and pineapple peel of immature pineapples are selected, the process routes for pineapple picking and preprocessing, freezing, drying, smashing, extracting, concentrating, extracting, separating, column chromatography isolation, gradient elution and re-crystallization are designed, the process design is reasonable, the toxicity of adopted solvents is small, noharsh condition is adopted, a high-purity N-fatty acyl-sphingol substance can be obtained, on the basis of NMR, MS and HPLC detection, the detection result displays that the N-fatty acyl-sphingol substance is 1-O-beta-D-glucose-N-docosanedioic acyl-hexadecanoic-4,10(E,E)-diene psychosine, the purity reaches 98.7%, the yield is increased to 0.13% from 0.0004%, and the method is suitable for large-scale technological production.