Code tool

Diffraction Grating Calculator

Enter grating density in lines per millimetre, wavelength in nanometres, and an integer diffraction order.

In-browser processingNo account requiredPrivacy details ↗

Diffraction angle: —

Calculated locally. Ideal grating at normal incidence; no efficiency, finite-width, or material effects.

---

A QUICK WALKTHROUGH

How to use this tool

  1. Enter grating density in lines/mm and wavelength in nm.
  2. Enter an integer diffraction order, including zero, and calculate.
  3. Review the angle in degrees and the model limitations.

Formula and scope

For normal incidence, d = 1/g and sin θ = mλ/d. The entered wavelength is converted from nm to m and grating density from lines/mm to lines/m. Independent reference: OpenStax University Physics Volume 3, Diffraction Gratings (https://openstax.org/books/university-physics-volume-3/pages/4-4-diffraction-gratings). The order m must be an integer, including zero. Rejects |mλ/d| > 1 because no real angle exists. Ideal grating only; angle is reported in degrees.

GOOD TO KNOW

Common questions

What assumptions does this use?

It assumes an ideal grating at normal incidence and does not model efficiency, finite-width, or material effects.

Why can a calculation be rejected?

If |mλ/d| is greater than 1, the sine equation has no real diffraction angle.

Are values uploaded?

No. The calculation runs locally in this browser.