The direct interaction of hairpin DNA with 9-hydroxyfluorene (9-OHFLU) through hydrogen bonds was investigated by electrochemical impedance spectroscopy (EIS), UV-Vis spectroscopy and 1H NMR spectra. Based on these results, an electrochemical hairpin DNA sensor was developed for the detection of 9-OHFLU by EIS. Upon 9-OHFLU interacting with hairpin DNA film on the gold electrodes, the charge transfer resistance (RCT) of the hairpin DNA film was significantly increased and remained constant after 30 min. Depending on the difference in charge transfer resistance (ΔRCT) before and after 9-OHFLU interaction with the hairpin DNA, 9-OHFLU could be detected with a concentration as low as 1 nM. However, only a much smaller ΔRCT appeared when eight selected hydroxyl polycyclic aromatic hydrocarbons (HO-PAHs) interacted with the hairpin DNA for 30 min, which demonstrated that 9-OHFLU could be discriminated from other HO-PAHs by EIS. The performance of the sensor in real lake water sample was further explored for the detection of 9-OHFLU with the detection limit of 4 nM.