In this paper the displacement of the reflection resonant peak resulting from the change of the gap between the guided-mode resonance (GMR) grating and substrate is used to measure the nanometer gap. The paper calculates double layer model and metal substrate model using rigorous coupled-wave analysis (RCWA). It is revealed that nano-gap detection using GMR grating is feasible for both dielectric and metal substrate. The detection range of resonant wavelength and gap is tunable. The detect sensitivity is investigated by varying the parameters of grating (thickness, period and refractive index), the thickness of films, and polarization. Tolerance of grating implies an advantage for manufacture. An optimized result presents an 18nm resonant shift for 100nm gap with the max sensitivity achieving 0.85.© (2010) COPYRIGHT SPIE--The International Society for Optical Engineering. Downloading of the abstract is permitted for personal use only.