Diffraction Grating Calculator
Find where each order of a diffraction grating goes, how many orders exist, and how finely the grating can separate wavelengths.
🌈 What is a Diffraction Grating Calculator?
A diffraction grating is a surface with a large number of equally spaced parallel lines or slits. When light passes through it, or reflects from it, each slit sends out its own wave, and the waves add up. In most directions they cancel. In a few special directions they arrive in step and reinforce, producing bright, narrow beams called orders. The directions are given by the grating equation d sin θ = m λ, where d is the spacing between neighbouring lines, λ is the wavelength and m is the whole number that labels the order. This calculator solves that equation for the angle of any order, for the number of lines per millimetre, and for the largest order that can exist.
Gratings are the working part of most spectrometers. Astronomers use them to spread starlight into spectra and read the chemical makeup of stars. Chemists use them to measure absorption and emission lines, and physics students use them to measure the wavelength of a laser or a sodium lamp. In optical communications a grating can combine or separate channels at different wavelengths, and the shiny rainbow on the surface of a compact disc is a natural grating made of tightly spaced tracks. Because the angle depends on the wavelength, every order above zero is a spread-out spectrum, with the shortest wavelength closest to the straight-through beam.
There are a few ideas that cause errors. The central maximum, m = 0, always goes straight through, whatever the wavelength. The order number is limited, because sin θ can never be larger than 1, so the highest order is the largest whole number below d / λ. The formula changes if the light arrives at an angle, and this page includes the incidence angle for that reason. Finally, the sharpness of the lines depends on the total number of lines that are lit. That is described by the resolving power R = m N, which tells you the smallest difference in wavelength that the grating can separate.
The three modes cover the usual lab and exam questions. Order angles gives the direction of each beam, with a table and a chart of all the orders. Find the grating works backwards from a measured angle to the ruling. Resolving power tells you whether a grating can split a close pair such as the sodium doublet. For the speed that links wavelength and frequency, see the speed of light calculator.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 — Green Light on a 600 Lines/mm Grating
550 nm light at normal incidence, 600 lines/mm, first order
Example 2 — Second Order of Sodium Light
589 nm light, 300 lines/mm, second order
Example 3 — Light Arriving at 30 Degrees
400 nm light at 30° incidence, 1000 lines/mm, first order
Example 4 — Finding the Ruling From a Laser
A 632.8 nm helium-neon laser gives its second-order spot at 20°
Example 5 — Resolving the Sodium Doublet
589.3 nm, 600 lines/mm, 10 mm of the grating lit, first order, doublet gap 0.597 nm
Example 6 — An Order That Does Not Exist
700 nm light, 300 lines/mm, order 5
❓ Frequently Asked Questions
🔗 Related Calculators
What is the diffraction grating equation?
For light at normal incidence the maxima satisfy d sin(theta) = m lambda, where d is the spacing between lines, theta the angle from the normal, m the order (0, 1, 2 and so on) and lambda the wavelength. For 550 nm light on a 600 lines/mm grating the first order is at 19.27 degrees.
How do you convert lines per mm to slit spacing?
Divide 1 mm by the number of lines: d = 1 / N. For 600 lines/mm, d = 1/600 mm = 1.667 micrometres. For 300 lines/mm, d = 3.333 micrometres.
How do you find the maximum order of a grating?
The sine of the angle cannot exceed 1, so m must be less than d / lambda. For d = 1.667 micrometres and 550 nm, d / lambda = 3.03, so the highest order is 3. The calculator counts both sides of the central maximum, here 7 beams.
Why does a grating split white light into colours?
The angle of each order depends on the wavelength through sin(theta) = m lambda / d. Each colour therefore leaves at its own angle, and every order above zero is a spectrum with violet closest to the central beam and red farthest.
What is the resolving power of a diffraction grating?
Resolving power is R = lambda / delta lambda = m N, where N is the number of illuminated lines. A grating lit over 6000 lines in the first order has R = 6000 and can separate lines 0.098 nm apart near 589.3 nm.
How many lines are needed to resolve the sodium doublet?
The two sodium D lines are about 0.597 nm apart near 589.3 nm. In the first order you need N of at least 589.3 / 0.597, which rounds up to 988 lines. A 600 lines/mm grating therefore needs about 1.65 mm of its width illuminated.
What happens when the light does not hit the grating head on?
The equation becomes d (sin(theta_m) - sin(theta_i)) = m lambda. With 400 nm light at 30 degrees incidence on a 1000 lines/mm grating the first order is at 64.16 degrees, and the orders are no longer symmetric about the normal.
What does a diffraction grating spectrometer measure?
It measures the angle of a spectral line. If the grating spacing and the order are known, the wavelength follows from lambda = d sin(theta) / m. Reversing it, a known laser wavelength and a measured angle give the lines per mm.
Why do higher orders overlap?
The second-order blue can fall at the same angle as the third-order red, because m lambda is the same. Spectrometers use filters or limit the range so that the orders do not overlap.
What is the difference between a grating and a double slit?
Both use d sin(theta) = m lambda for the bright maxima. With many slits the maxima become much narrower and brighter, so a grating gives sharp lines that can be measured accurately, while two slits give broad fringes.
Is a larger grating spacing better?
Not for spreading colours. A larger spacing gives smaller angles and more orders but less dispersion. A finer ruling spreads the spectrum more widely, up to the point where only the first order still exists.