About the Diffraction Grating Calculator
This diffraction grating calculator applies the grating equation d sin θ = mλ. Enter the grating’s line density (lines per millimetre, per centimetre or per inch) or its slit spacing, the wavelength of the light and the diffraction order, and it returns the angle of the bright fringe, its position on a screen at a given distance, and the highest order the grating can produce. A table lists the angle of every visible order.
Switch modes to work backwards from a measured angle to the wavelength — the classic school spectroscopy experiment with a laser or a gas discharge lamp. It is useful for physics students, teachers setting up optics practicals, and hobbyists building spectrometers from DVD or holographic gratings.
The calculator assumes light strikes the grating at normal incidence (perpendicular) in air, and measures angles from the straight-through (zero-order) beam. Orders exist only while mλ/d ≤ 1; higher orders would need sin θ above 1 and do not appear.
How to use the diffraction grating calculator
- 1Choose whether to find the diffraction angle or the wavelength.
- 2Enter the grating density (lines per mm, cm or inch) or the slit spacing.
- 3Enter the wavelength, or the angle you measured.
- 4Set the diffraction order and, optionally, the distance to the screen.
- 5Read the result and check the table for every order the grating produces.
Formula and method
A diffraction grating is a surface with many equally spaced slits or grooves. Light from neighbouring slits interferes constructively only where the extra path length d sin θ is a whole number m of wavelengths, giving sharp bright lines at angles θ = arcsin(mλ/d). Because the angle depends on wavelength, a grating spreads white light into a spectrum, with red bent more than violet.
The slit spacing is the reciprocal of the line density — 600 lines/mm means d = 1/600 mm = 1.667 µm. Since sin θ cannot exceed 1, the highest order is the whole-number part of d/λ. On a flat screen a distance L away, the bright spot appears y = L tan θ from the central beam. The formula assumes normal incidence; for light arriving at angle θi use d(sin θ + sin θi) = mλ.
- d
- Spacing between adjacent lines (slits)
- θ
- Diffraction angle from the central beam
- m
- Diffraction order (1, 2, 3 …)
- λ
- Wavelength of the light
- L
- Grating-to-screen distance
- y
- Distance of the bright spot from the centre
Worked examples
532 nm green laser through a 600 lines/mm grating
d = 1/600 mm = 1,666.7 nm, so sin θ = 532 / 1,666.7 = 0.319 and θ = 18.61°. On a screen 1 m away the first bright spot is 0.337 m from the centre. Since d/λ = 3.13, orders up to m = 3 appear.
Finding a wavelength: 1200 lines/mm, first order at 30°
d = 833.3 nm and λ = d sin θ / m = 833.3 × 0.5 / 1 = 416.7 nm, which is violet light.
Second-order red line, 300 lines/mm, screen at 2 m
sin θ = 2 × 650 / 3,333.3 = 0.39, so θ = 22.95°. On a screen 2 m away the spot is 2 × tan 22.95° = 0.847 m from the centre. This coarser grating shows five orders.
Frequently asked questions
What is the diffraction grating equation?+
For light hitting the grating at right angles, d sin θ = mλ, where d is the line spacing, θ the angle of a bright line from the central beam, m the order and λ the wavelength.
How do I convert lines per mm to slit spacing?+
Take the reciprocal: d = 1 / N. For 600 lines/mm, d = 1/600 mm = 0.001667 mm = 1.667 µm = 1,667 nm. For lines per inch, divide 25.4 mm by the number of lines.
How many orders can a grating produce?+
The maximum order is the largest whole number not exceeding d/λ, because sin θ cannot be larger than 1. A 600 lines/mm grating with 532 nm light shows up to the third order on each side.
Why does a grating split white light into colours?+
Each wavelength diffracts at its own angle, θ = arcsin(mλ/d). Longer red wavelengths are bent more than shorter violet ones, so white light spreads into a spectrum in every order except the zero order.
How is a grating different from a double slit?+
Both use the same condition for bright fringes, but a grating has hundreds or thousands of slits. That makes its bright lines far sharper and brighter, which is why gratings are used in spectrometers.