The diffraction grating calculator above solves the grating equation for the angle of any order, and then reports the three things that decide whether a grating is actually suitable for a measurement: how many orders exist, how far apart the equation spreads neighbouring wavelengths, and how fine a wavelength difference the illuminated area can separate. An angle on its own rarely settles a design question. Those three do.
Arb Digital publishes free physics calculators that go past the first equation, because the first equation is usually the easy part. A grating with a thousand lines per millimetre and one with six hundred both give an angle for green light in first order. Only the dispersion and resolving power figures tell you which one will actually separate two spectral lines you care about.
What This Diffraction Grating Calculator Does
You enter the groove density in lines per millimetre, the wavelength in nanometres and the order you want. The tool converts groove density to a spacing, applies the grating equation including any angle of incidence you set, and returns the diffraction angle. If the order you asked for does not exist at that wavelength and spacing, it says so explicitly rather than producing a number from an out-of-range arcsine.
The supporting grid gives the groove spacing itself, which is worth seeing because it is the quantity the physics uses; the highest order that exists for your combination; the angular dispersion, which is how much the angle moves per nanometre of wavelength change; and the smallest wavelength difference the grating can resolve given the illuminated width you entered.
The illuminated width field deserves attention because it is easy to misread. Resolving power depends on the number of grooves the beam actually covers, not on how large the grating is. A 50 mm grating illuminated by a 2 mm beam resolves like a 2 mm grating. Overfilling the grating wastes light; underfilling it wastes resolution.
How to Use It
- Enter the groove density from the grating's specification. Common laboratory values run from about 300 to 2,400 lines per millimetre. Higher densities disperse more strongly but support fewer orders.
- Enter the wavelength in nanometres. Visible light runs roughly 380 to 750 nm. For a spectral line, use the published vacuum or air wavelength rather than a rounded figure, since dispersion calculations are sensitive to it.
- Start with order one and work up. First order is brightest for most gratings. Higher orders disperse more but are dimmer and overlap each other, and beyond the maximum reported here they do not exist at all.
- Set the angle of incidence if the grating is tilted. Normal incidence is zero. A tilted grating shifts every order and can bring a wavelength into a fixed detector position, which is how scanning monochromators work.
- Set the illuminated width to the beam, not the grating. The resolving power figure depends entirely on how many grooves are lit, so an optimistic width gives an optimistic resolution.
The Formula: The Grating Equation
For light arriving perpendicular to the grating, constructive interference occurs where d sin θ = mλ, with d the groove spacing, m the integer order and λ the wavelength. With light arriving at an angle θi the general form is d(sin θi + sin θm) = mλ. OpenStax University Physics Volume 3, section 4.4 on diffraction gratings, derives the normal-incidence case from the limit of many slits and shows why the maxima become sharp as the number of grooves grows.
Work the default through. A grating with 600 lines per millimetre has a groove spacing of one six-hundredth of a millimetre, which is 1,666.7 nm. For 550 nm light in first order, sin θ = 550 ÷ 1,666.7 = 0.330, so θ = 19.27°. In second order sin θ = 0.660 and θ = 41.30°. In third, sin θ = 0.990 and θ = 81.89°, close to grazing. Fourth order would need a sine of 1.320, which is impossible, so three is the highest order that exists here.
Angular dispersion is the derivative of the grating equation: dθ÷dλ = m ÷ (d cos θ). In first order at 19.27° that comes to about 0.0364 degrees per nanometre. Resolving power is R = mN, where N is the number of illuminated grooves. Ten millimetres of a 600-line grating gives 6,000 grooves, so first-order resolving power is 6,000 and the smallest resolvable gap at 550 nm is 550 ÷ 6,000 = 0.092 nm.
Why Higher Orders Disappear
The grating equation demands a sine, and a sine cannot exceed one. That single constraint sets the highest order: mmax is the largest integer no greater than d÷λ at normal incidence. It is a hard physical limit, not a practical one. There is no clever optical arrangement that produces a fourth order where the equation says none exists.
The consequence is a trade that runs through all grating design. A finely ruled grating has a small d, which gives large angles and strong dispersion in first order — excellent for separating close wavelengths. But small d also means d÷λ is small, so few orders exist. A 1,800-line grating has a spacing of 555.6 nm, so for 550 nm light only first order exists at all, and it emerges at almost 82 degrees.
A coarse grating gives the opposite. Large spacing supports many orders, each disperses more strongly than the last, and you can trade brightness for dispersion by choosing which order to use. The cost is that orders overlap: second-order 300 nm ultraviolet arrives at the same angle as first-order 600 nm orange, because the equation only cares about the product mλ. Real instruments suppress this with order-sorting filters, and forgetting them is a classic source of phantom spectral features.
Dispersion and Resolving Power Are Different Things
This distinction decides whether an instrument works, and the two are routinely confused. Angular dispersion tells you how far apart two wavelengths land in angle. It depends on the order and the groove spacing, and it can be increased by ruling the grating more finely or working in a higher order. Resolving power tells you whether those two wavelengths are actually distinguishable once they land, and it depends on the total number of illuminated grooves.
You can have plenty of dispersion and still not resolve a doublet. Each diffracted order has a finite angular width set by the number of grooves — more grooves, narrower peak. If the peaks are wider than the separation between them, spreading them further apart does not help, because they spread together. The Rayleigh criterion sets the boundary at R = λ÷Δλ = mN.
Try the sodium preset. The sodium D lines sit at 589.0 and 589.6 nm, a gap of 0.6 nm, so resolving them needs R of about 982. In first order that requires 982 illuminated grooves, which a 600-line grating provides in under two millimetres of beam. Resolving them is easy; what is harder is finding published wavelengths accurate enough to trust, and the NIST Atomic Spectra Database is the standard source for those.
Reflection, Transmission and Blazing
The equation on this page applies equally to transmission gratings, where light passes through, and reflection gratings, where it bounces off. Sign conventions differ between references for reflection gratings, but the magnitudes of the angles are the same, and the tool treats incidence and diffraction on the same side of the normal as positive.
What the equation says nothing about is how much light ends up in each order. That is set by the shape of each groove. A grating with a triangular groove profile — a blazed grating — is cut so that the direction of specular reflection from the groove face coincides with the diffraction direction of one chosen order at one chosen wavelength. That order then receives most of the light, sometimes eighty per cent or more, while the others are starved.
The practical reading is that a blazed grating has a wavelength it is optimised for, and efficiency falls away either side of it. Two gratings with identical groove density can behave very differently, and no angle calculation reveals that. Check the manufacturer's efficiency curve. For the closely related case of X-rays scattering from atomic planes rather than ruled grooves, the Bragg's law calculator handles that geometry, which uses a factor of two the optical grating equation does not have.
Arb Digital builds free tools like this one because useful pages earn attention. If you want tools, calculators or content built for your own audience, we can help.
Browse All Free Tools Talk to Arb DigitalCommon Mistakes to Avoid
- Assuming every order exists — the required sine cannot exceed one, so a fine grating may support only first order and nothing beyond it.
- Confusing dispersion with resolving power — spreading wavelengths further apart does not help if each peak is broader than the gap. Resolving power depends on the number of illuminated grooves.
- Using the physical grating size for resolving power — only the grooves the beam actually covers contribute. An underfilled grating resolves like a small one.
- Ignoring order overlap — second-order light at half a wavelength lands at the same angle as first order, which produces spectral features that are not really there without an order-sorting filter.
- Expecting the equation to predict brightness — it gives angles only. How much light reaches each order depends on groove profile and blaze, which the manufacturer's efficiency curve describes.
Related Free Tools From Arb Digital
For X-ray diffraction from crystal planes use the Bragg's law calculator, and for refraction at a boundary the Snell's law calculator. Wave relationships are covered by the wavelength calculator and the frequency converter, and the quantum side by the photon energy calculator and the de Broglie wavelength calculator. Angle work is helped by the unit circle calculator, and lengths convert with the length converter. The full free online tools hub lists everything Arb Digital publishes.
Frequently Asked Questions
At normal incidence it is d times the sine of the diffraction angle equals the order times the wavelength. With light arriving at an angle, the sines of the incidence and diffraction angles add. The groove spacing d is the reciprocal of the groove density.
Because the equation would need a sine greater than one, which is impossible. The highest order at normal incidence is the largest whole number no bigger than the groove spacing divided by the wavelength, so finely ruled gratings support very few orders.
Dispersion is how far apart in angle two wavelengths land. Resolving power is whether they can be told apart once they land, and it depends on the number of illuminated grooves. High dispersion with few grooves gives widely spaced but broad and overlapping peaks.
Only the part the beam illuminates. Resolving power is the order multiplied by the number of grooves the light actually covers, so a large grating lit by a narrow beam performs like a small one.
Because the equation depends on the product of order and wavelength. Second-order light at 300 nanometres satisfies the same condition as first-order light at 600, so both appear at the same angle unless an order-sorting filter removes one.
Bragg's law describes reflection from stacked crystal planes and contains a factor of two, because the path difference involves travelling into the crystal and back out. The grating equation describes interference between adjacent surface grooves and has no such factor.
No. The grating equation gives angles only. The distribution of light between orders depends on the groove profile, and blazed gratings are shaped to concentrate light into one chosen order near one design wavelength.
This tool is provided for educational and study use. It applies the ideal grating equation and does not model groove profile, blaze efficiency, polarisation, ghosts or stray light, so treat its output as geometry rather than an instrument specification.