A method for synthesizing sapropterin dihydrochloride, characterized in that it comprises the following steps: Step 1: a compound 1 of the formula is subjected to epoxidation to generate a compound 2 of the formula wherein X=NH or O, R=C1-C6 alkane or benzyl; Step 2: in the presence of acetone, a Lewis acid, an inorganic base liquid, the compound 2 of the formula reacts to generate a compound 3 of the formula Step 3: the compound 3 of the formula reacts in an alkaline solution, a polar solvent is used to dissolve a filter cake obtained through centrifugation, then a resolving reagent is added to perform resolution to obtain a compound 4 of the formula wherein n=0,1; Step 4: dissolving the compound 4 of the formula in an ether solvent, and performing separation in acidic conditions to obtain an organic phase, and adding N,N-diisopropylethylamine to the organic phase to obtain a compound 5 of the formula Step 5: using the compound 5 of the formula as a raw material to synthesize a compound 6 of the formula Step 6: reacting the compound 6 of the formula with a trinitride to generate a compound 7 of the formula Step 7: subjecting the compound 7 of the formula to hydrogenation to obtain a compound 8 of the formula Step 8: reacting the compound 8 of the formula and a compound A of the formula to generate a compound 9 of the formula Step 9: subjecting the compound 9 of the formula to cyclization to obtain a compound 10 of the formula Step 10: adding a catalyst to the compound 10 of the formula introducing hydrogen to perform a reaction, and then perform quenching in hydrochloric acid having a concentration of 10% to 20% to obtain sapropterin dihydrochloride. Step 1: a compound 1 of the formula is subjected to epoxidation to generate a compound 2 of the formula wherein X=NH or O, R=C1-C6 alkane or benzyl; Step 2: in the presence of acetone, a Lewis acid, an inorganic base liquid, the compound 2 of the formula reacts to generate a compound 3 of the formula Step 3: the compound 3 of the formula reacts in an alkaline solution, a polar solvent is used to dissolve a filter cake obtained through centrifugation, then a resolving reagent is added to perform resolution to obtain a compound 4 of the formula wherein n=0,1; Step 4: dissolving the compound 4 of the formula in an ether solvent, and performing separation in acidic conditions to obtain an organic phase, and adding N,N-diisopropylethylamine to the organic phase to obtain a compound 5 of the formula Step 5: using the compound 5 of the formula as a raw material to synthesize a compound 6 of the formula Step 6: reacting the compound 6 of the formula with a trinitride to generate a compound 7 of the formula Step 7: subjecting the compound 7 of the formula to hydrogenation to obtain a compound 8 of the formula Step 8: reacting the compound 8 of the formula and a compound A of the formula to generate a compound 9 of the formula Step 9: subjecting the compound 9 of the formula to cyclization to obtain a compound 10 of the formula Step 10: adding a catalyst to the compound 10 of the formula introducing hydrogen to perform a reaction, and then perform quenching in hydrochloric acid having a concentration of 10% to 20% to obtain sapropterin dihydrochloride.