The invention belongs to the technical field of productions of chemical products, in particular to a method for preparing 5-hydroxymethylfurfural. The method includes steps of taking a macromolecular polyphosphazene polymer matrix as a solid acid type heterogeneous catalyst, taking monosaccharide, disaccharide or polysaccharide as raw materials, reacting for 5minutes to 24 hours in single-component solvent or double-component solvent such as dimethyl sulfoxide, acetonitrile, methyl isobutyl ketone, water and the like at the temperature of 25-120 DEG C under normal pressure, and finally producing the 5-hydroxymethylfurfural efficiently. The method has the advantages that conversion efficiency of raw material is high, HMF selectivity is good, operation conditions are mild, reaction speed is high, the processing is simple and environment-friendly, the catalyst is easy to prepare and the like, corrosion to equipment and environment pollution due to common liquid strong-acid homogenous catalysts are avoided, and a new way is developed for preparing commodity chemicals and substitute fuels according to regenerative biological resources.