Audited 31 Jul 2026·Last updated 15 Sept 2026·3 citations·Tier 2·0 uses

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

m
m
Principal diffraction angle
14.4775
Result of θ = asin(mλ/d) using the entered coherent-SI magnitudes.
Model scope
Normal-incidence ideal grating principal maximum; incidence angle, finite slit width/count, blaze, efficiency, polarization, resolving power, medium index, and uncertainty are outside it.

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.

  1. Enter the wavelength in metres — a green 532 nm laser pointer is 5.32e-7.
  2. 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).
  3. Enter the order m as a positive integer, starting with 1 for the innermost bright fan.
  4. Read the angle from the grating normal; symmetric twins of every order appear on both sides of the straight-through beam.
  5. 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.

θ = asin(mλ/d)

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.

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.

diffraction Order1
wavelength M0
grating Spacing M0

Frequently asked questions.

Why do higher orders appear at larger angles, and why do they stop?
Order m requires the slit-to-slit path difference d·sinθ to reach m whole wavelengths, and the only way to buy more path difference is a steeper angle. The supply runs out at 90°, where the path difference maxes at d itself — so orders beyond m = d/λ are geometrically impossible. The worked example's 2 µm grating at 500 nm supports exactly m ≤ 4.
How do I convert lines per millimetre to the spacing d?
Invert: d = 1 mm / N = 0.001/N metres. A 600 line/mm grating has d = 1.67 µm; 1,200 lines/mm gives 0.83 µm. This is the single most error-prone step in grating work — a spacing entered in millimetres instead of metres inflates every mλ/d by a thousand and makes the calculator report that no orders exist, which is itself a useful symptom to recognise.
What happens with white light instead of a laser?
Each wavelength obeys the equation separately, so every order beyond m = 0 fans out into a spectrum — violet (≈400 nm) nearest the axis, red (≈700 nm) farthest, the reverse of a prism's ordering. The zeroth order stays white because θ = 0 for every λ. From the second order outward the spectra grow wide enough to overlap: 700 nm in m = 2 lands at the same angle as 467 nm in m = 3, which is why spectrometers add order-sorting filters.
Does the equation change if light hits the grating at an angle?
Yes — the general form is d(sinθ_i + sinθ_m) = mλ, with the incidence angle contributing its own path difference. This page fixes normal incidence (θ_i = 0), which recovers d·sinθ = mλ. Tilted incidence is not a defect but a design tool: it shifts which orders exist and where, and blazed spectrometer gratings exploit it to steer most of the light into one chosen order.
Why are grating maxima so much sharper than double-slit fringes?
With two slits, moving slightly off the ideal angle only partially dims the sum. With N ruled lines — tens of thousands on a real grating — the same small misalignment distributes N phases evenly around a circle and they cancel almost exactly, leaving bright lines of angular width proportional to 1/N. That sharpness is quantified as resolving power R = λ/Δλ = mN: a 600 line/mm grating illuminated over 25 mm resolves Δλ ≈ 0.04 nm in first order — enough to split the sodium doublet.

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
Coming soon