Quantum well infrared photodetectors (QWIP) are flexible in tailoring their characteristics to suit an application. In this article, we present a design and optimization concept to construct an infrared spectrometer. It utilizes the broadband absorption of a QWIP and the narrow band light coupling of a grid structure. The QWIP material defines the range of detection wavelengths of the spectrometer while the grid geometry selects out different wavelengths to detect in different detector elements. We will present specific design examples in two wavelength ranges, one from 7.5 to 12 μm and another from 6 to 15 μm. We will also present some experimental results to support the design feasibility.