Rapid and sensitive detection of cancer biomarkers is crucial for cancer screening, early detection, and improving patient survival rate. The present study proposes an electrochemical gene-sensor capable of detecting tumor related TP53 gene mutation hotspots by self-assembly of sulfhydryl ended hairpin DNA probes tagged with methylene blue (MB) onto a gold electrode. By performing a hybridization reaction with the target DNA sequence, the gene-sensor can rearrange the probe’s structure, resulting in significant electrochemical signal differences by differential pulse voltammetry. When the DNA biosensor is hybridized with 1 μM target DNA, the peak current response signal can decrease more than 60%, displaying high sensitivity and specificity for the TP53 gene. The biosensor achieved rapid and sensitive detection of the TP53 gene with a detection limit of 10 nmol L−1, and showed good specific recognition ability for single nucleotide polymorphism (SNP) and base sequence mismatches in the TP53 gene affecting residue 248 of the P53 protein. Moreover, the biosensor demonstrated good reproducibility, repeatability, operational stability, and anti-interference ability for target DNA molecule in the complex system of 50% fetal bovine serum. The proposed biosensor provides a powerful tool for the sensitive and specific detection of TP53 gene mutation hotspot sequences and could be used in clinical samples for early diagnosis and detection of cancer.