The invention discloses a preparation method of erlotinib hydrochloride. The preparation method comprises the following steps of using 3,4-dihydroxy benzaldehyde (compound I) as a starting raw material; converting an aldehyde group into a cyano group; undergoing six-step reactions of oxyalkylating a side chain, nitrating, hydrolyzing the cyano group, reducing a nitro group, cyclizing and performing salt formation to obtain the erlotinib hydrochloride. According to a synthetic method, the starting material is simple, low in price and easily-obtained; compared with an existing route of first closing ring, then chloridizing and finally ammonifying; the synthetic method disclosed by the invention has the advantages that steps are reduced, the yield is increased, the reaction process is easy in operation and the preparation cycle is shorter; meanwhile, the use of chlorinating agents such as phosphorus trichloride, phosphorus pentachloride, thionyl chloride, phosgene or phosphorus oxychloride with corrosivity is also avoided; the preparation method is suitable for industrial production.