The invention relates to a DNA sensor based on a thin film transistor and a preparation method thereof.The DNA sensor comprises the thin film transistor and a DNA molecular probe, the thin film transistor comprises a substrate, a gate electrode, an insulating layer, source and drain electrodes and a semiconductor layer, the substrate, the gate electrode and the insulating layer are sequentially arranged from bottom to top, the semiconductor layer is arranged on the insulating layer, and the source and drain electrodes are in contact with the semiconductor layer, and the DNA molecular probe is fixed on the source and drain electrodes. Compared with the prior art, the source and drain electrodes are used as the substrate, and the DNA molecular probes are fixed on the source and drain electrodes, so that the influence of physical absorption on the organic semiconductor layer on moisture and certain ions is avoided, charge injection is improved, the saturation current and carrier mobility of the sensor are enhanced, and the stability and sensitivity of the DNA sensor are improved.