The invention relates to a method for preparing ganciclovir. The method comprises the following steps of: a, adding paraformaldehyde into 1,3-dichloro-2-propanol [2], reacting under the action of a catalyst to obtain hemiformal [3], and reacting with an acetic anhydride to obtain 1,3-dichloro-2-acetoxylmethoxylpropane [4]; b, making 1,3-dichloro-2-acetoxylmethoxylpropane [4] react with absolute postassium acetate or anhydrous sodium acetate in an organic solvent medium in the presence of a tetraalkyl ammonium bromide catalyst with 1-20 carbon atoms and an acetic anhydride serving as a dehydrating agent to obtain 1,3-diacetoxy-2-acetoxymethoxyl propane [5]; c, performing a condensation reaction on 1,3-diacetoxy-2-acetoxymethoxyl propane [5] and 2,9-diacetyl guanine [6] in an organic solvent medium in the presence of a catalyst and an acetic anhydride serving as a dehydrating agent to obtain triacetyl ganciclovir [7]; and d, hydrolyzing the triacetyl ganciclovir [7] to obtain ganciclovir [1]. The method has the advantages of easy and controllable preparation process, high utilization ratios of raw materials, low cost and high yield of a prepared ganciclovir product.