The invention discloses a method for preparing biodiesel from microalgae. The method comprises steps as follows: a culture medium is inoculated with haematococcus pluvialis, the haematococcus pluvialis is irradiated with a red and blue LED light-compensating lamp for 8-10 h every day and cultured at 23-25 DEG C for 7-8 d, and haematococcus pluvialis cells can be collected; the collected haematococcus pluvialis cells are subjected to wall breaking treatment with ultrasonic waves, extraction is performed with an organic solvent, microalgae oil is obtained, the microalgae oil, methanol and a zeolite molecular sieve catalyst are added to a reactor in the weight ratio being 1:(3-5):(0.01-0.03) for an esterification reaction, an esterification product is obtained, separated and purified, and the biodiesel can be obtained. According to the method, the haematococcus pluvialis which is short in production cycle, wide in application range, high in photosynthesis and high in oil content is taken as a raw material, and the problem of vegetable oil raw materials in the biodiesel development process is solved. Meanwhile, the method has the advantages that the preparation process is simple, the catalytic efficiency is high, the oil extraction rate is high, the product yield is high and the like, and a good foundation is laid for industrialization and mass production of biodiesel.