Diffraction Grating Calculator
Diffraction grating calculator: θ = asin(mλ/d) locates each bright order from wavelength, line spacing, and order, with the mλ ≤ d cutoff rule.
Diffraction Grating Calculator
Background.
Shine a laser through a grating — a surface ruled with thousands of lines per millimetre — and the beam emerges not as a smear but as a fan of sharp spots at precisely predictable angles. The grating equation locates them: d·sinθ = mλ, solved here as θ = asin(mλ/d) for the m-th order spot given wavelength λ and line spacing d.
Each spot marks a direction in which light from every slit arrives in step. The path difference between neighbouring slits is d·sinθ; when that difference is a whole number m of wavelengths, thousands of wavelets reinforce, and the more lines contribute, the sharper the spot. The integer m is the order: m = 0 is the undeviated straight-through beam, m = 1 the first fan on either side, and so on.
The geometry contains its own limit. Since sinθ cannot exceed 1, only orders with mλ ≤ d exist at all — a 2 µm-pitch grating illuminated at 500 nm produces exactly four fans (m ≤ 4), and asking for the fifth returns no answer because there is none. Coarse gratings crowd many dim orders near the axis; fine gratings throw few orders at wide, well-separated angles, which is what spectroscopy wants.
Because the angle depends on λ, a grating sorts colours: this is the dispersive heart of nearly every optical spectrometer, from teaching kits to telescope instruments — and the rainbow a CD's 1.6 µm track spacing throws around a room. The page computes the ideal normal-incidence principal maxima; blaze, efficiency, slit width, and tilted incidence belong to real instrument design, and the scope note beside the result draws that line.
What is diffraction grating calculator?
The diffraction grating equation d·sinθ = mλ gives the angles θ at which a grating of line spacing d sends constructive-interference maxima of wavelength λ, one for each integer order m satisfying mλ ≤ d. It is the multi-slit generalisation of Young's double-slit maxima: the same in-step condition, but with thousands of contributing slits the maxima sharpen into the narrow bright lines that make gratings precision instruments for separating and measuring wavelengths.
How to use this calculator.
- Enter the wavelength in metres — a green 532 nm laser pointer is 5.32e-7.
- Enter the line spacing d in metres; gratings are usually specified in lines per millimetre, so convert with d = 0.001/N (600 lines/mm → 1.667e-6 m).
- Enter the order m as a positive integer, starting with 1 for the innermost bright fan.
- Read the angle from the grating normal; symmetric twins of every order appear on both sides of the straight-through beam.
- Step m upward to map the whole pattern, stopping when mλ/d would exceed 1 — beyond that the order simply does not exist, which is the fastest check that your spacing conversion was right.
The formula.
Two neighbouring slits a distance d apart send light toward a far screen at angle θ with a path difference of d·sinθ — the extra leg one wavefront travels. Constructive interference needs that difference to be an integer number of wavelengths: d·sinθ = mλ. What a grating adds over two slits is redundancy: the same condition aligns slit 1 with slit 2, slit 2 with slit 3, and so on across every ruled line, so slightly off-condition angles that two slits would only dim are cancelled almost completely by the ensemble — the origin of a grating's razor-thin lines and its resolving power R = mN. Inverting for the angle gives θ = asin(mλ/d), defined only while mλ/d ≤ 1; the argument reaching 1 puts the order at grazing 90°, and larger arguments mean the order is evanescent. Dispersion follows by differentiating: dθ/dλ = m/(d·cosθ), so higher orders and finer gratings spread colours further apart. The engine evaluates the arcsine in Decimal arithmetic and reports degrees, rounding once to twelve significant digits.
A worked example.
A green laser at λ = 500 nm (5×10⁻⁷ m) hits a grating with lines 2 µm apart (2×10⁻⁶ m), and we want the first-order angle, m = 1. The interference condition asks what fraction of a wavelength the slit-to-slit path difference must be: mλ/d = (1 × 5×10⁻⁷)/(2×10⁻⁶) = 0.25. So the first bright fan lies where sinθ = 0.25, i.e. θ = asin(0.25) ≈ 14.48° off the straight-through beam — on both sides, symmetrically. The full pattern follows by counting: m = 2 needs sinθ = 0.5 (30°), m = 3 needs 0.75 (48.6°), m = 4 needs exactly 1.0 — a grazing 90° order right along the grating surface — and m = 5 would need sinθ = 1.25, which no angle supplies. Four orders exist, and the neat arithmetic (d is exactly 4λ) is why this example is a favourite: the order cutoff m ≤ d/λ lands on a whole number.
Frequently asked questions.
Why do higher orders appear at larger angles, and why do they stop?
How do I convert lines per millimetre to the spacing d?
What happens with white light instead of a laser?
Does the equation change if light hits the grating at an angle?
Why are grating maxima so much sharper than double-slit fringes?
References& sources.
How this page was produced
- Published by
- Quanta Calculator
- Primary sources
- 3 cited below
- Method
- θ = asin(mλ/d)
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled