Ratiometric signal detection has been widely used in bioelectrochemical sensors because of the good stability and selectivity. A novel biosensor is reported for nucleic acid detection based on the ratio of the oxidation peak current ratio between ferrocene (Fc) and methylene blue (MB) (I Fc/I MB) using a proximity-dependent surface hybridization strategy. The design of hairpin capture was shown to reduce the possibility of the hybridization with the detection probe in the absence of the target which improved the specificity. Moreover, this approach improved the signal stability. Additionally, a linear relationship was observed between the ratio of I Fc/I MB and the logarithm of the absolute value of DNA concentration from 1.0 × 10−12 M to 1.0 × 10−16 M. This biosensor possessed high sensitivity with a detection limit as low as 0.64 × 10−16 M. Moreover, good selectivity was obtained for the biosensor by identifying the target of the single-base mismatch. Therefore, this ratiometric electrochemical biosensor has great potential applications for nucleic acid detection and medical clinical diagnosis.