Diffraction Grating Calculator for reflection, transmission and monochromator setups. Solve the angle, wavelength or lines per mm, then view every order, dispersion and resolution.
Grating equation mλ = d(sin α + sin β), angles from the grating normal.
Grating and Spectrometer
L is the focal length, or the screen distance for spot positions.
Ray Diagram and Orders
| Order | Angle β | Spot at L | Dispersion |
|---|---|---|---|
| 0 | −30.00° | −57.74 mm | 0 °/nm |
| +1 | 3.44° | 6.011 mm | 0.0574 °/nm |
| +2 | 38.32° | 79.02 mm | 0.1461 °/nm |
Spot at L is the distance on a flat screen at L from where the grating normal meets it. The screen faces the grating on the light source side.
Step-by-Step Working
- d = 1 ÷ N = 1 ÷ 1,000 lines/mm = 1,000 nm
- mλ = d(sin α + sin β), so sin β = mλ ÷ d − sin α
- sin β = +2 × 560.0 nm ÷ 1,000 nm − sin(30.00°) = 1.12000 − 0.50000 = 0.62000
- β = arcsin(0.62000) = 38.32°
- Angular dispersion = m ÷ (d cos β) = +2 ÷ (1,000 nm × 0.78460) = 0.002549 rad/nm
- Resolving power R = |m| × W ÷ d = 2 × 10,000 lines = 20,000
- Littrow blaze wavelength λB = 2d sin θB ÷ |m| = 2 × 1,000 nm × sin(30.00°) ÷ 2 = 500.0 nm
- Result: 38.32° Diffraction Angle
How the Diffraction Grating Calculator Works
The Diffraction Grating Calculator is a diffraction calculator built around the grating equation. It has five modes in its Solve For menu, with Diffraction Angle as the default.
Angle of Incidence, Wavelength and Line Density work backward from an angle you know or measured. Monochromator Angles sets up a constant-deviation spectrometer, where the grating turns and the slits stay fixed.
Enter the wavelength in nanometers, micrometers, angstroms or centimeters. Line density takes lines per mm, lines per cm or lines per inch. You can also type the grating spacing d in micrometers instead.
The diffraction order m is a whole number such as 1, 2 or −1. The angle of incidence α is measured from the grating normal, so 0° means light arriving straight on. Order 0 is not accepted, because it has no dispersion.
The folded Grating and Spectrometer section sets the grating type to reflection or transmission. It also takes the focal length or screen distance L and the illuminated width W, which drive the spot positions, dispersion and resolving power.
Reflection gratings also have a Blaze Angle field, set to 30° by default. Enter the blaze angle from the grating’s label or data sheet, or 0 if you do not know it. The result then tells you how close your wavelength is to the blaze.
Reading the Results
The default case is a 1,000 lines/mm reflection grating, 560 nm light, order +2 and 30° incidence. The Diffraction Grating Calculator returns a diffraction angle of 38.32°, on the same side of the normal as the incoming light.
The first card converts the line density, here to a spacing of 1.0000 µm, 10,000 lines per cm and 25,400 lines per inch. The second card lists the orders that actually leave the grating, which are 0, +1 and +2 for this setup.
The third card gives the dispersion, 0.1461° per nanometer. The fourth gives the resolving power of 20,000 for a 10 mm wide beam. That means it can separate two lines just 0.028 nm apart near 560 nm.
Below the cards sit a ray diagram with every formed order, a table of angles and spot positions, and the step-by-step working. A closing note compares your wavelength with the blaze wavelength and checks which other wavelengths land on the same angle.
Diffraction Grating Equation
The diffraction grating equation links the order, wavelength, groove spacing and the two angles. For a reflection grating it is written as below, with both angles measured from the grating normal.
$$m \lambda = d \left( \sin\alpha + \sin\beta \right)$$
Here m is the order, λ is the wavelength and d is the groove spacing. α is the angle of incidence and β is the diffraction angle. This is the form used in the MKS Diffraction Grating Handbook by Christopher Palmer.
In the handbook’s sign convention, β is positive on the same side of the normal as the incoming light. Order 0 is the plain mirror reflection, so it leaves at β = −α. The calculator follows this same convention for reflection gratings.
For a transmission grating the calculator uses mλ = d(sin β − sin α). With light arriving straight on, α = 0, both forms reduce to the simple normal-incidence equation used in most physics classes.
$$m \lambda = d \sin\theta$$
Solving for the Angle of Incidence
Sometimes the exit direction is fixed, such as a detector port or a fiber, and you need to know how to tilt the grating. The Angle of Incidence mode rearranges the equation to sin α = mλ ÷ d − sin β for a reflection grating.
Run the default case backward as a check. With 1,000 lines/mm, 560 nm, order +2 and an exit angle of 38.32°, the Diffraction Grating Calculator returns α = 30.00°. It works for transmission gratings too, using their own form of the equation.
Diffraction Grating Lines per mm Formula
Gratings are sold by line density N, but the equation needs the spacing d. The two are inverses of each other, so d = 1 ÷ N. A 1,200 lines/mm grating has d = 1 ÷ 1,200 mm, which is 833.3 nm.
$$d = \frac{1}{N}$$
The spacing d is also called the grating element. A grating with 5,000 lines per centimeter has a grating element of 1 ÷ 5,000 cm, which is 2 × 10⁻⁴ cm or 2.0 µm. Enter 5,000 lines per cm and the first card shows it straight away.
Lines per inch work the same way. A 15,000 lines per inch grating has d = 0.0254 m ÷ 15,000 = 1.693 × 10⁻⁶ m. That equals 590.6 lines per mm, a common density for teaching gratings.
Working backward, take 6 × 10⁻⁵ cm light sent to 30° in first order. The grating needs d = λ ÷ sin 30° = 1.2 × 10⁻⁴ cm, which is about 8,333 lines per cm. The Line Density mode in the Diffraction Grating Calculator does this for any angle and order.
How Many Orders a Grating Forms
An order only exists when sin β stays between −1 and +1. The handbook writes this as |mλ ÷ d| < 2, which allows for light arriving at a steep angle. At normal incidence it tightens to |m| ≤ d ÷ λ.
Take a grating with 6,000 lines per cm and light at 4,500 Å. The spacing is 16,667 Å, so d ÷ λ = 3.70. Orders 1, 2 and 3 appear on each side of the central beam, giving seven beams in all including order 0.
The second card of the Diffraction Grating Calculator counts these for any setup. The ray diagram draws each one, and the table lists their angles. For large spacing it shows the orders near your chosen one, order 0 and the two outermost.
If you type an order that the grating cannot form, the error message gives the range it can. With 6,000 lines per cm, 4,500 Å and m = 5, it reads that the grating forms orders −3 to +3 only.
Worked Example for a Physics Lab
A common lab setup shines a 532 nm green laser straight through a 600 lines/mm transmission grating onto a screen 1 m away. The spacing is 1,666.7 nm, so sin β = 532 ÷ 1,666.7 = 0.3192 in first order.
That gives β = 18.61°. On a flat screen 1 m away, the spot lands at L × tan β. That is 1,000 mm × 0.3368 = 336.8 mm from the central beam. The Spot at L column in the calculator’s table gives this same distance.
The second order leaves at 39.67°, and the third at 73.3°. A fourth order would need sin β = 1.28, so it is not formed. Used this way, the tool works as a diffraction grating calculator for physics lab sheets, from angle to spot spacing.
Dispersion and Resolving Power
For spectroscopy, the Diffraction Grating Calculator gives more than the angle. Angular dispersion tells you how far apart two colors land, per nanometer of wavelength. It grows with the order and the line density, and rises again as β gets steeper.
$$\frac{d\beta}{d\lambda} = \frac{m}{d \cos\beta}$$
In the default case that is 0.002549 rad/nm, or 0.1461° per nm. With a 100 mm focal length, the colors spread 0.255 mm apart per nanometer at the focal plane. The reciprocal, 3.923 nm/mm, is the figure spectrometer makers usually quote.
A flat screen behaves differently. There a spot sits at L × tan β, so the spread grows by a further factor of 1 ÷ cos²β. In the default case the colors land 0.414 mm apart per nanometer on a flat screen 100 mm away, not 0.255 mm.
Resolving power R sets the smallest gap between two wavelengths the grating can split. It equals the order times the number of grooves the beam covers. The beam covers W × N grooves, so a 10 mm beam on 1,000 lines/mm lights 10,000 lines.
$$R = \frac{\lambda}{\Delta\lambda} = m N_{lit}$$
The sodium D lines at 589.0 nm and 589.6 nm make a classic test. They sit 0.597 nm apart, so R needs to reach about 987. In first order that takes roughly 1,000 lit grooves, or just 1 mm of a 1,000 lines/mm grating.
Resolving power follows the same Rayleigh idea as a telescope’s limit. Two lines count as resolved when one peak falls on the first dark fringe of the other. The Angular Resolution Calculator applies that rule to apertures and stars.
Free Spectral Range and Order Overlap
Orders can overlap. Light of wavelength λ in order m leaves at the same angle as λ × m ÷ (m + 1) in the next order. The free spectral range, λ ÷ m, is the stretch of wavelengths you can use before that happens.
In the default case the free spectral range is 280 nm. The calculator’s closing note also names the overlapping lines, 373.3 nm in order +3 and 1,120 nm in order +1. Both leave at the same 38.32° as 560 nm in order +2.
If your source emits those wavelengths, the detector cannot tell them apart. Spectrometers block them with an order-sorting filter, usually a long-pass filter placed before the grating or detector.
Diffraction Grating Monochromator
Most monochromators keep the entrance and exit slits fixed and rotate only the grating. The angle between the incoming and outgoing beams, the deviation angle α − β, stays constant. The handbook writes this with the half-deviation K.
$$m \lambda = 2 d \cos K \sin\psi, \qquad K = \frac{\alpha – \beta}{2}$$
Here ψ is the scan angle the grating turns to. Then α = ψ + K and β = ψ − K. The Monochromator Angles mode takes the wavelength, line density, order and deviation, and returns all three angles.
As a diffraction grating monochromator check, take a 1,200 lines/mm grating with a 24° deviation. In the Diffraction Grating Calculator, 500 nm light in first order needs ψ = 17.86°. That puts the incidence at 29.86° and the diffraction at 5.86°.
Setting the deviation to 0° gives the Littrow mount, where light returns along its own path. The equation becomes mλ = 2d sin α. A 632.8 nm helium-neon line on a 1,200 lines/mm grating sits in Littrow at 22.31°.
Reflection and Transmission Gratings
The two main types of grating are reflection and transmission. A reflection grating has a mirror coating, and its orders come back on the light-source side. A transmission grating is clear, and its orders pass through to the far side.
Gratings are also grouped by how they are made. Ruled gratings have grooves cut one by one with a diamond tool. Holographic gratings are recorded with laser interference patterns, which gives very regular grooves and low stray light.
A crystal acts as a three-dimensional grating for X-rays, with atomic planes in place of ruled lines. The Bragg’s Law Calculator handles that case, where the spacing is a fraction of a nanometer.
A grating spreads any light source into its spectrum. A hot filament gives a smooth band of color, and the Blackbody Radiation Calculator shows where that spectrum peaks for a given temperature.
Grating Efficiency
Efficiency is the share of light that goes into the order you want. It depends on the groove shape, the blaze angle, the coating and the polarization of the light, not only on the grating equation. Makers such as HORIBA publish measured efficiency curves for each grating.
A blazed grating has sawtooth grooves tilted at the blaze angle θB. It sends the most light into one order near one wavelength, called the blaze wavelength. In the Littrow mount that wavelength follows a simple rule.
$$m \lambda_B = 2 d \sin\theta_B$$
Take the default 1,000 lines/mm grating blazed at 30°. In second order it peaks at λB = 2 × 1,000 nm × sin 30° ÷ 2 = 500 nm. The 560 nm light in the default case sits at 1.12 times that, just to the long side of the peak.
The efficiency often differs a lot between the two polarizations, called TE and TM by grating makers. These match the s and p light used by the Brewster’s Angle Calculator. This tool finds where the light goes, while an efficiency curve tells you how much arrives there.
Lines per Inch, Line Counts and Grating Types
These answers cover the grating questions people search for most. They run from line density choices to the total number of lines on a grating and what the word grating means outside optics.
What is a 15000 lines per inch diffraction grating used for?
Gratings of about 15,000 lines per inch are widely used for teaching. The University of Melbourne, for example, uses 4,000, 8,000 and 15,000 lines/inch gratings with a laser in lecture demonstrations of diffraction.
At normal incidence, such a grating sends 400 nm violet light to 13.66° and 700 nm red light to 24.42° in first order. The full visible spectrum spreads across about 11°, which is easy to see by eye or on a screen.
Why is a diffraction grating with 20,000 lines per inch better than one with 15,000?
More lines per inch means a smaller spacing, so the colors spread wider. A 20,000 lines/inch grating sends 400 nm to 18.36° and 700 nm to 33.45°. That is about 15° of spread, against 11° for the 15,000 lines/inch grating.
Over the same width it also lights more grooves, so its resolving power is a third higher. The trade-off is fewer orders. Red 700 nm light reaches second order on the 15,000 grating, but only first order on the 20,000 grating.
How many lines are ruled on a grating?
The total is the line density times the ruled width. A 25 mm wide grating at 1,200 lines/mm carries 30,000 lines. Only the lines inside the beam count for resolving power, which is why the calculator asks for the illuminated width W.
The number of lines in a grating can also be found from a measurement. Measure the angle of a known laser line and solve for line density in the Diffraction Grating Calculator. Then multiply by the grating width.
What are 5 examples of diffraction?
The rainbow on a CD comes from its spiral track, about 1.6 µm apart, which acts as a reflection grating. Spectrometers in labs and telescopes use gratings to split starlight and lamp light into spectra.
Holographic security labels use fine gratings to show shifting colors. Street lights seen through a fine curtain or umbrella fabric show small cross-shaped patterns. X-rays diffracting from crystals reveal the spacing of atoms inside them.
Is this a steel grating calculator?
No. Searches for grating weight in kg, 19 W/4 grating or the span of a grating refer to steel bar grating used for floors and walkways. That is a structural product, sized by bar spacing, load and span.
The Diffraction Grating Calculator deals with optical gratings, where the spacing is around a micrometer and the concern is where light goes. For steel grating weight, use the bar sizes and weight tables from the grating maker.