The invention provides a preparation method of high-quality anhydrous rare earth chloride and bromide. The preparation method comprises the following steps: (1) carrying out pre-dehydration on the rare earth halide REX<3>-xH<2>O to obtain crude anhydrous REX<3>, wherein X is elemental Br and/or Cl, RE is any one rare earth element or two or more rare earth elements consisting of Y, Sc, La, Ce, Pr,Nd, Sm, Pm, Eu, Gd, Tb, Dy, Ho, Er, Tm, Yb and Lu, and x is no less than 0 and no more than 7; (2) vacuumizing the crude anhydrous REX<3> obtained in the step (1) under water-isolated and oxygen-isolated conditions; and (3) carrying out gradient heating on a system formed in the step (2) in a plurality of stages from 200-1500 DEG C, and carrying out distillation purification on the target objectREX<3> to obtain the high-purity anhydrous REX<3> with the absolute purity of more than or equal to 99.99%. According to the preparation method of the high-quality anhydrous rare earth chloride and bromide, different substances in a material are separated through process control, so the anhydrous rare earth halide with extremely high absolute purity is obtained; and the preparation method is relatively low in process cost, and easy for industrial production.