Resonant nanogratings and periodic metasurfaces express diverse spectral and polarization properties on broadside illumination by incident light. Cooperative resonance interactions may yield shaped spectra for particular applications, in contrast to a multilayer dielectric mirror. Here, we provide guided-mode resonance filters with flat-top spectra suitable for wavelength division multiplexing systems. Applying a single one-dimensional grating layer sandwiched by two waveguides, we theoretically achieve high-efficiency flat-top spectra in the near-infrared region. This result is obtained by inducing simultaneous nearly degenerate resonant modes. The resonance separation under this condition controls the width of the flat-top spectrum. This means we can implement spectral widths ranging from a sub-nanometer to several nanometers applying fundamentally the same device architecture.