The detection of disease-related DNA is of great significance for early and accurate diagnosis and therapy. In this work, we successfully achieved the sensitive detection of target DNA based on a thioflavin T (ThT)-induced G-quadruplex fluorescent biosensor. ThT, a water-soluble fluorescent dye, can induce G-rich sequences to form G-quadruplexes and obtain an obviously enhanced fluorescence. In this work, it was employed to construct a biosensor for the detection of HIV. When the target HIV existed, the hairpin DNA probes would be opened in succession and release the completely exposed G-rich sequence to combine with ThT. The simple and rapid biosensor performed satisfactory selectivity; it also exhibited sensitivity with a detection limit of 2.4 nM. With good performance in human serum, we believe that this optical biosensor has the potential to be applied to the practical detection of target DNA.