Aims. While solar spectra contain a lot of Ca i and Mg i infrared (IR) lines, no laboratory-measured spectra of these atoms have been reported for wavenumbers below 2000 cm −1 . This study reports Ca i spectra in the 1300-4500 cm −1 range and Mg i spectra in the 1300-4500 cm −1 range. Methods. We performed a time-resolved Fourier transform infrared spectroscopy study of a plasma created by the laser ablation of MgF 2 and CaF 2 targets in a vacuum. The oscillator strengths (f-values) were calculated using quantum defect theory (QDT), which shows good agreement with the available experimental and theoretical results.Results. We report several Ca i and Mg i IR lines that have not been measured previously in laboratory. The recorded spectra allow the excitation energies of some Ca i and Mg i states with high orbital momentum (l = 4, 5) to be determined. We also provide a long list of QDT-calculated f-values for Ca i and Mg i in the range of 800-9000 cm −1 .