Diffraction Grating Calculator
Find the diffraction angle for any order of light passing through a grating using the grating equation. Ideal for optics lab work, spectroscopy setups, and physics coursework.
About this calculator
A diffraction grating splits light into its component wavelengths by exploiting interference between waves scattered from regularly spaced slits or grooves. The grating equation is: sin(θ) = (m × λ) / d, where θ is the diffraction angle, m is the diffraction order (an integer: 0, ±1, ±2, …), λ is the wavelength of light, and d is the grating spacing (distance between adjacent slits). The calculator evaluates sin(θ) = (order × wavelength) / gratingSpacing and returns θ in degrees via the arcsine function. If the ratio exceeds 1, no real angle exists for that combination — the order is physically inaccessible and the calculator flags it. Higher diffraction orders spread wavelengths further apart but require finer gratings or longer wavelengths to remain accessible.
How to use
Suppose you shine green laser light (wavelength = 532 nm) onto a grating with spacing d = 1500 nm, and you want the first-order (m = 1) diffraction angle. Step 1 — Enter 532 in Wavelength. Step 2 — Enter 1500 in Grating Spacing. Step 3 — Enter 1 in Diffraction Order. Step 4 — The calculator checks: (1 × 532) / 1500 = 0.3547, which is ≤ 1. Step 5 — θ = arcsin(0.3547) ≈ 20.77°. The first-order green beam exits the grating at about 20.8° from the central axis.
Frequently asked questions
What happens when the diffraction grating calculator says no valid angle exists?
This occurs when the value of (m × λ) / d exceeds 1, because the arcsine function is only defined for inputs between −1 and 1. Physically, it means the chosen combination of order, wavelength, and grating spacing would require the diffracted beam to travel at more than 90° from the grating normal — an impossible geometry. To fix this, you can use a finer grating (smaller spacing d), a shorter wavelength, or a lower diffraction order. It is a common situation when trying to observe higher orders with coarse gratings or long-wavelength infrared light.
How does grating spacing affect the diffraction angle of light?
Grating spacing d and diffraction angle θ are inversely related: a finer grating (smaller d) produces larger diffraction angles for the same wavelength and order. This is why high-resolution spectroscopes use gratings with thousands of lines per millimetre — the widely separated spectral lines are easier to distinguish. Conversely, a coarse grating bunches all orders close to the central maximum and may make many higher orders inaccessible altogether. Choosing the right grating spacing is therefore a trade-off between angular dispersion (resolution) and the number of accessible diffraction orders.
What is the zeroth diffraction order and why is it not useful for spectroscopy?
The zeroth order (m = 0) corresponds to straight-through, undeviated light — sin(θ) = 0 regardless of wavelength, so θ = 0° for all colours. Because the grating does not disperse different wavelengths in zeroth order, it carries no spectral information and simply acts like a mirror or window. Spectroscopy relies on first order (m = 1) and higher, where different wavelengths exit at different angles and can be separated and measured. The zeroth-order beam is still useful as a reference for alignment and for measuring the total incident intensity.