Diffraction Grating Simulator — Multi-Slit Spectral Order Interactive

Interactive multi-slit diffraction laboratory showing sharp spectral orders produced by a diffraction grating, with adjustable wavelength and lines-per-millimeter, live order-angle calculation, and coarse/typical/fine grating presets.

← Optics Labs
About this tool — how it works & FAQOpen ▾Close ▴

About the Diffraction Grating Simulator

This simulator passes light through a diffraction grating — many closely spaced slits — and shows how it produces sharp, well-separated diffraction orders on a screen, the working principle behind spectrometers and spectroscopes.

What the simulator shows

• A ray diagram with the incoming beam, a fine multi-slit grating, and rays for each diffraction order fanning out to a screen. • Two live controls: wavelength (400-700 nm) and lines per millimeter (100-1200). • A live readout for the grating spacing d and the first-order diffraction angle θ₁. • Three preset gratings: coarse (100 lines/mm), typical (500 lines/mm), and fine (1200 lines/mm).

The grating equation

d sinθₘ = mλ describes the angles at which constructive interference occurs for a grating with slit spacing d, for integer diffraction order m (0, ±1, ±2, and so on). The central m=0 order is always undeviated white light (all wavelengths overlap there); higher orders separate different wavelengths at different angles, spreading a spectrum.

Why gratings give sharper lines than a double slit

A double slit produces broad, gradually-fading interference fringes because only two wave sources are combining. A grating with hundreds or thousands of slits per millimeter combines light from many more sources at once — at any angle except the exact constructive-interference condition, the contributions from all those slits cancel almost completely, producing very sharp, narrow bright lines instead of broad fringes. This is exactly what makes gratings useful for precisely measuring wavelengths in spectrometers.

Frequently asked questions

What is the grating equation?

d sinθₘ = mλ, where d is the spacing between adjacent slits, θₘ is the angle to the m-th order maximum, and λ is the wavelength.

Why are diffraction grating lines sharper than double-slit fringes?

A grating combines light from many more slits than a double slit. Away from the exact constructive-interference angle, contributions from all those extra slits cancel out almost completely, narrowing the bright bands into sharp lines.

What happens to higher diffraction orders at fine gratings (many lines per mm)?

Finer gratings (smaller slit spacing d) push diffraction angles larger for a given order. Beyond a certain point, the grating equation has no valid solution (sinθ would exceed 1) and that order simply does not appear.

Why does a diffraction grating separate colors like a prism?

Because the diffraction angle for a given order depends on wavelength (d sinθₘ = mλ), different colors bend to different angles for the same order, spreading white light into a spectrum — though by a completely different physical mechanism than a prism's dispersion.

Related tools & guides