The invention provides a method for preparing biodiesel from microalgae. The method comprises the following steps of: a. changing collected microalgae from the wet algae into algae block or algae powder; b. mixing a catalyst into low-carbon alcohol, directly adding the algae block or the algae powder obtained by the step a, and carrying out ester exchange reaction to prepare the biodiesel; c. after the reaction is stopped, adding an organic solvent for extracting reaction solution which is divided into organic solvent phase used for extraction, low-carbon alcohol water-adding phase and algae mud; and d. after the extraction is completed, collecting the organic solvent phase used for extraction, removing the organic solvent by distillation, and obtaining oily liquid, namely crude products of the biodiesel. After preparing the biodiesel, the steps that the low-carbon alcohol water-adding phase is used circularly after dewatered by a solid drying agent, and the produced algae mud is used for producing biogas by biological fermentation are added. The invention completes the oil extraction of microalgae and biodiesel production by one step, simplifies the technique steps and equipment, saves cost; the sulphuric acid and low-carbon alcohol used for production can be recovered, then dewatered by drying, then utilized repeatedly, the cost is reduced, the final product is neutral, does not need washing and reduces the downstream processing pressure; and simultaneously, chlorophyll is mainly concentrated in the low-carbon alcohol, reduces the interference of the chlorophyll to the color of the product and does not need the step of decoloring.