Aptamer switches that undergo conformational changes upon binding to their targets, have emerged as powerful tools for biosensing. However, generating an intramolecular aptamer switch has been challenging, as a given aptamer sequence usually did not inherently have a suitable structure-switching functionality. In this study, an intramolecular aptamer switch for oxytetracycline (OTC) was rationally designed, by integrating an aptamer sequence specific to OTC, a short complementary DNA (cDNA) strand, a fluorophore and a quencher into one DNA molecule. In the absence of OTC, the short cDNA hybridized to a segment of the aptamer, leading to the 6-carboxyfluorescein (FAM) labeled at 3' end was in a proximity with the black hole quencher Ⅰ (BHQ1) labeled at 5' end, and fluorescence was quenched. In the presence of OTC, aptamer preferred to bind with OTC, rather than hybridizing with cDNA, causing the fluorophore departed from the fluorescence quencher, and fluorescence recovered. OTC concentrations could be rapidly determined within 3 min by measurement of fluorescence intensity. A linear detection range of 20 nmol/L to 2.5 μmol/L, with a limit of detection (LoD) of 2 nmol/L, was achieved by this sensing method. This intramolecular aptamer switch also displayed good selectivity to OTC and satisfactory anti-interference in complex matrices including milk, urine and lake water. Recovery rates were between 94.7% and 108.7%, implying its potential for application.