[Objective] The aim was to explore an optimized method to measure the artificial pigment by means of high performance liquid chromatograph.[Method] The gradient elution technique of HPLC was used to isolate and analyze tartrazine and sunset yellow in the cereals.The pre-treatment temperature,ultrasonic time,the column temperature and the elution conditions were studied,and the best experimental conditions were confirmed.[Result] At 40 ℃,the optimum chromatography analysis condition was moving phase,with pH(6.8),methanol/water of acetic acid-ammonium acetate(0.02 mol/L),and column temperature(35 ℃).Gradient elution condition was 20%-35% methanol,3%/min;35%-98%,6%/min;98%,8 min.The content of tartrazine and sunset yellow in cereal was tested precisely by the means of HPLC.The average recoveries of standard addition were 97.9% and 100.2%,and the detection limit were 0.02 mg/kg and 0.03 mg/kg.[Conclusion] This method shortened the analysis time,improved the detection sensitivity and the resolution of artificial color.