The invention relates to 4-alkyl-2-aryl amino-5-(1,2,4-triazol-1-yl)thiazole shown as a chemical structural formula I and a salt thereof. The chemical structural formula I is shown in the specifications, wherein R is selected from H, alkyl with 1-2 carbon atoms, or straight chain alkyl or branch chain alkyl with 3-4 carbon atoms; and X1, X2, X3, X4 and X5 is selected from hydrogen, alkyl with 1-2 carbon atoms, hydroxyl, methoxyl, oxethyl, trifluoromethyl, fluorine, chlorine, bromine, nitro or amino. A preparation method of the 4-alkyl-2-aryl amino-5-(1,2,4-triazol-1-yl)thiazole comprises the following steps of: feeding 2-(1,2,4-triazol-1-yl)-2-bromoalkylketone and aryl thiourea in the molar ratio of 1:1, and carrying out a reflux reaction in ethanol; and after reacting, distilling under reduced pressure to remove a solvent, adding ethyl acetate for washing, filtering, drying to obtain 4-alkyl-2-aryl amino-5-(1,2,4-triazol-1-yl)thiazole hydrobromide, neutralizing the hydrobromide with ammonia water, extracting with ethyl acetate, drying, and distilling under reduced pressure to obtain 4-alkyl-2-aryl amino-5-(1,2,4-triazol-1-yl)thiazole. The 4-alkyl-2-aryl amino-5-(1,2,4-triazol-1-yl)thiazole has high antitumor activity, and can be applied to preparation of an anticancer medicament.