The invention discloses an electrochemical sensor, a preparation method and application thereof in quick detection of aflatoxin B1 (AFB1). The electrochemical sensor comprises a three-electrode system and a detection cell, wherein the three-electrode system comprises a working electrode, an Ag / AgCl reference electrode and a platinum wire counter electrode, and the working electrode is a modified gold electrode; the detection cell is filled with a base solution formed by an electroactive indicator and a buffer solution; the electrodes are modified by utilizing DAN to perform electrochemical detection on AFB1, expensive monoclonal AFB1 antibody is not needed, the problems of complicated operation, high cost, high sample amount, long time consumption and the like of general chromatography and immunological detection methods can be solved, and instant detection of AFB1 is realized. The electrochemical sensor is convenient and quick, has the advantages of high detection sensitivity, 10 ng / mL low detection limit, small required sample amount, extremely low detection cost, small interference and the like, and can be used for quickly, easily, conveniently and accurately quantitatively detecting AFB1.