Rapid and accurate detection of pesticide residues in food matrices are of great significance to food safety. This study aimed to characterize the fingerprint peaks of 2,4-dichlorophenoxyacetic acid (2,4-D) and to enhance its detection accuracy in food matrices by using terahertz (THz) time-domain spectroscopy. Density functional theory was used to simulate molecular dynamics of 2,4-D peaks (1.35, 1.60, 2.37 and 3.00 THz). Four baseline correction methods, including asymmetric least squares smoothing (AsLS), adaptive iteratively reweighted penalized least squares (AirPLS), background correction (Backcor), baseline estimation and denoising with sparsity (BEADS) were compared and used to eliminate spectral baselines of Zizania latifolia (ZIZLA), rice and maize containing 2,4-D residues, from 0.1 to 4 THz. Based on the peak information of 1.35 THz, the detection limit and accuracy of 2,4-D residues in these food matrices were significantly improved after THz spectral baseline correction, providing a new feasibility for food safety and agricultural applications.