Terahertz spectroscopic characteristics are related to the large amplitude vibration of molecules and their interaction, so it can be used for molecular detection. Sodium nitrate and sodium nitrite are two very important salts in people's lives. Sodium nitrate is usually used as quick-acting fertilizer in acidic soil, but excessive use will cause certain pollution to the environment. If sodium nitrate is heated, it becomes very stable sodium nitrite, which is usually added to food as a preservative and colorant, but excessive consumption of nitrite can lead to food poisoning and even death. Therefore, it is necessary to detect sodium nitrate and sodium nitrite. Based on THz-TDS system, the spectral characteristics of sodium nitrate and sodium nitrite in 0.1-1 THz band were studied. Polyethylene, sodium nitrate and sodium nitrite were mixed in proportion of 1:1, 1:2, 1:3, 1:4 and 1:5, respectively. The mixture was evenly grinded and stirred, and then pressed. The prepared samples were tested in THz-TDS system, and the time-domain spectra of the samples with different proportions were obtained. The terahertz frequency spectrum and absorption spectra of the two samples at different ratios were obtained by Fourier transform. After comparing spectra of the two samples, it is found that they have their own absorption peaks, and their peak positions are obviously different. Therefore, it is very important to study these two substances by terahertz technology.