This paper demonstrates our optical measurement systembased on near-infrared tunable diode laser absorptionspectrometry and reports the results of trace moisturedetermination in nitrogen and ammonia gases. A near-infrared InGaAsP distributed feedback diode laser operating at room temperature was employed as the opticalsource. We used a dual-cell detection strategy to cancelcommon mode noise from the diode laser and remove theeffect of the residual moisture absorption in the beam pathoutside the sample cell. We also used this method tosuccessfully eliminate the interfering absorption of matrixgas molecules such as NH3. The detection limit of H2Oabsorption of 4 ppb in nitrogen and 12 ppb in ammoniawas obtained using a single-pass absorption cell of only92 cm in length and the average results of 10 scanmeasurements. This system has characteristics of boththe high sensitivity and capability of in situ and real-timemeasurement.