Diffraction Grating Calculator
Grating Equation · Diffraction Orders · Wavelength & Angle
ephotonics
@ephotonics
Weekly laser engineering guides and new calculators released directly in your feed.
Follow on LinkedInHow the Diffraction Grating Calculator Works
A diffraction grating is an optical component with a periodic structure that splits and diffracts light into several beams traveling in different directions. The angle at which a specific wavelength (color) leaves the grating is dictated by constructive interference.
This behavior is governed by the universal Grating Equation, which maps the relationship between groove spacing, incident angle, and the diffracted orders.

Understanding the Variables:
- θm Diffracted Angle: The output angle of the diffracted beam, measured from the grating normal.
- θi Incident Angle: The input angle of the light source, measured from the grating normal.
- λ Wavelength: The wavelength of the incident light (usually measured in nanometers).
- m Diffraction Order: An integer representing the interference maximum (m = 0 is the direct reflection/transmission, m = ±1 are the primary diffracted beams).
- d Grating Period: The physical distance between adjacent grooves on the grating (d = 1 / Groove Density).
Why calculate Diffraction Angles?
- Spectroscopy: Spreading light to analyze chemical composition.
- Laser Tuning: Selecting a specific wavelength (Littrow configuration).
- Pulse Compression: Chirped Pulse Amplification (CPA) for ultrafast lasers.
- Telecommunications: Wavelength filtering in WDM systems.
Dispersion and Order
Unlike a prism, which relies on refraction, a diffraction grating relies on interference. This allows for much higher dispersion (separation of colors) and is more predictable.
The "Order" (m) is crucial. m=0 is just a reflection (like a mirror). m=1 is the first dispersed spectrum. Higher orders (m=2, 3) offer more dispersion but often overlap, which is why calculating the exact angles is vital to avoid "ghosts" in your data.
1. Spectrometers (Czerny-Turner)
The heart of almost every spectrometer is a reflective grating. By rotating the grating (changing θi), different wavelengths (λ) are directed onto the detector slit. This calculator mimics that rotation math.
2. Littrow & Littman Configs
External Cavity Diode Lasers (ECDL) use a grating to tune the laser color. In the "Littrow" configuration, the light is reflected directly back to the source (θi = θm). You can solve this by setting input/output angles to match in the formula.
3. Pulse Compression
Ultrafast femtosecond lasers use pairs of gratings to stretch and compress pulses. The angle of incidence dictates the "chirp" applied to the pulse. Precision here prevents the laser from damaging its own amplifier.
4. Beam Steering
Transmissive gratings are increasingly used in LIDAR and AR/VR headsets to steer beams non-mechanically. Calculating the diffraction angle allows engineers to map the Field of View (FOV) of the device.