An aptamer based assay is presented for the determination of the antibiotics oxytetracycline (OTC) and kanamycin (KAN). Magnetic beads were applied for separation, and gold nanoparticles (AuNPs) for signal amplification. DNA aptamers against OTC and KAN were firstly designed. After specific recognition events, the aptamer sequences were released from the surface of magnetic beads and the remaining DNA probes captured horseradish peroxidase (HRP) modified AuNPs. Subsequently, 3,3',5,5'-tetramethylbenzidine and o-phenylenediamine are catalytically oxidized by HRP, and the generated colorimetric responses can reflect the concentrations of OTC (at 370nm) and KAN (at 450nm), respectively. Experimental results demonstrate that the method is highly sensitive with the detection limit as low as 1 ag mL-1 for OTC and KAN. An extremely wide linear range (over 11 orders of magnitude) is achieved. The high selectivity is attributed to the high affinity between aptamer and the substrate. The results of real sample tests also verify that the method is promising for antibiotics analysis in the applications of food monitoring and clinical diagnosis. Graphical abstract Schematic presentation of a colorimetric assay for antibiotics based on aptamer-modified magnetic beads and horseradish peroxidase modified gold nanoparticles. Colorimetric responses result from the enzymatic oxidation of 3,3',5,5'-tetramethylbenzidine (TMB) and o-phenylenediamine (OPD), respectively.