A gas temperature and pressure measurement method based on Tunable Diode Laser Absorption Spectroscopy (TDLAS) detecting linewidth of gas absorption line was proposed in this paper. Combined with Lambert-Beer Law and ideal gas law, the relationship between temperature, pressure and gas linewidth with Lorentzian line shape was investigated in theory. Taking carbon monoxide (CO) at 1567.32 nm for example, the linewidths of gas absorption line in different temperatures and pressures were obtained by simulation. The relationship between the linewidth of second harmonic and temperature, pressure with the coefficient 0.025 pm/K and 0.0645 pm/kPa respectively. According to the relationship of simulation results and detected linewidth, the undefined temperature and pressure of CO gas were measured. The gas temperature and pressure measurement based on linewidth detection, avoiding the influence of laser intensity, is an effective temperature and pressure measurement method. This method also has the ability to detect temperature and pressure of other gases with Lorentzian line shape.