The invention relates to a rapid and accurate detection method for an ammonium nitrate explosive and belongs to the technical field of analytical chemistry. The method comprises the following six steps of preparing an ionic liquid stock solution, preparing standard NH4<+> and NO3<-> stock solutions, preparing an ionic liquid capillary electrophoresis buffer solution, preprocessing a capillary tube, measuring a normal concentration curve and analyzing exploding remnants. The detection method has the beneficial effects that a novel green solvent, namely ionic liquid, simultaneously serves as the electrophoresis buffer solution and an indirect ultraviolet detection back-ground electrolyte, so that the disadvantages that multiple reagents need to be used, the operation is complex, and the environment is polluted in a conventional method are overcome; furthermore, main ingredients, namely NH4<+> and NO3<-> ions of the exploding remnants of the ammonium nitrate explosive can be simultaneously separated and detected by virtue of the method, and the method is specific to the detection of the ammonium nitrate explosive; meanwhile, by combining an efficient capillary electrophoresis-ultraviolet detection technique, the analysis is accurate and rapid, the detection sensitivity is high, the reproducibility is good, the dosage of the reagent is low, and the method is easy to popularize and apply.