In this study, we designed, fabricated and demonstrated a compact wavelength detection system based on a gradient grating period guided-mode resonance filter (GGP-GMRF) mounted on a linear charge-coupled device (CCD) camera. The GGPGMRF was first fabricated through nanoreplica molding on a plastic substrate, followed by the deposition of a thin TiO2 film. The grating periods of the GGP-GMRF vary from 250 to 550 nm with a 2 nm increment in each period consisting of 100 cycles. The results show that a 6 mm long GGP-GMRF has a filtering range of 506 to 915 nm. Upon illumination, the GGP-GMRF reflects a particular wavelength of light resulting in the minimum transmission of that wavelength. Hence, the GGP-GMRF provides a spatially dependent minimum transmission depending on the wavelength of the incident light. The linear CCD underneath the GGP-GMRF measures the transmitted intensity, and the wavelength of the incident light can be correlated with the location of the minimum intensity. For the demonstrated GGP-GMRF and CCD system, a spectral resolution of 1 nm can be achieved.