Diffraction Grating Calculator
Find diffraction angles for a transmission or reflection grating. Uses the grating equation to determine output angles, angular dispersion, and resolving power for different diffraction orders.
A diffraction grating is the workhorse of modern spectroscopy. It's a surface with a regular pattern of parallel grooves (often 300–3600 grooves per millimeter), each acting as a tiny source of diffracted light. When monochromatic light hits the grating, the waves from each groove interfere — constructively in specific directions, destructively in most others. Different wavelengths interfere constructively at different angles, separating "white" light into its component colors with much higher resolution than a prism can achieve.
The fundamental relationship is the grating equation: mλ = d(sin α + sin β), where m is the diffraction order (integer), λ is wavelength, d is the groove spacing (d = 1/groove density), α is the incidence angle, and β is the diffraction angle. Solve for β to find where each wavelength diffracts. The first-order spectrum (m=1) is the brightest and most-used; higher orders give greater dispersion but lower intensity per order.
This calculator does the grating math: enter the groove density, incidence angle, wavelength, and order — and get the diffraction angle plus resolving power (R = m × N, where N is the total illuminated grooves). Gratings appear everywhere precision wavelength measurement matters: astronomical spectrographs, Raman and fluorescence spectrometers, atomic absorption analyzers, semiconductor laser modules, and even the back of a CD (which acts as a crude reflection grating, splitting room light into the rainbow you see).
Inputs
Number of grooves illuminated by the beam
Results
Diffraction Angle
-9.79°
Angular Dispersion
0.0349 °/nm
Resolving Power
10,000
Diffraction Grating Results
| Parameter | Value |
|---|---|
| Grating Spacing d | 1.6667 μm (1666.67 nm) |
| Diffraction Angle β | -9.7878° |
| Diffraction Order m | 1 |
| Angular Dispersion | 0.034885 °/nm |
| Resolving Power R | 10,000 |
| Min Δλ | 0.0550 nm |
| Groove Density | 600 lines/mm |
| Grating Equation | mλ = d(sinα + sinβ) |
Formula
How to use this calculator
- Enter the groove density in lines/mm (300–3600 typical for spectroscopy).
- Enter the angle of incidence (0° for normal incidence is the simplest case).
- Enter the wavelength of interest. Try sweeping across visible range (400–700 nm) to see how angles change.
- Pick a diffraction order. First order (m=1) is brightest and most common; higher orders give more dispersion.
- Read the diffraction angle β and the resolving power R = m × N.
- For overlapping orders, check whether your spectrum is in the "free spectral range" of your order.
Worked examples
Astronomy spectrograph design
**Scenario:** A stellar spectrograph uses a 600 lines/mm grating at first order. The beam illuminates 30 mm of the grating. What resolving power, and what's the resolvable wavelength difference at Hα (656.28 nm)? **Calculation:** N = 600 × 30 = 18,000 grooves. R = m × N = 1 × 18,000 = 18,000. Δλ = λ/R = 656.28/18,000 = 0.036 nm. **Result:** Δλ ≈ 0.04 nm resolution at Hα — good enough to detect typical stellar radial velocity Doppler shifts (10–100 m/s would give Δλ of 0.0002–0.002 nm, much less). For exoplanet detection, you'd need a higher-resolution echelle spectrograph (R > 100,000).
CD as a reflection grating
**Scenario:** A CD has data tracks spaced at 1.6 µm (= 625 tracks/mm equivalent). Shine red laser (650 nm) at normal incidence. Where does the first-order diffracted beam go? **Calculation:** d = 1600 nm. sin β = (1 × 650) / 1600 = 0.406. β = 24°. **Result:** First-order diffraction goes off at 24°. That's why a CD acts as a "rainbow mirror" under white light — different wavelengths diffract at different angles, splitting into the visible spectrum. The data spiral itself isn't a perfect grating (it's a single spiral, not parallel lines), but it's regular enough on small scales to act like one for incoherent white light.
Raman spectrometer choice
**Scenario:** Designing a Raman spectrometer for visible light (532 nm excitation). What grating density gives 0.5 nm resolution with a 25 mm beam? **Calculation:** Need R = λ/Δλ = 532/0.5 = 1064. R = m × N → N = 1064 / 1 (first order) = 1064 grooves illuminated. With 25 mm beam, density needed = 1064/25 = 42.6 lines/mm. Way more than needed; a standard 300 lines/mm grating gives N = 7500, R = 7500, Δλ = 0.07 nm — much better than 0.5 nm. **Result:** Even a low-density 100 lines/mm grating exceeds the resolution target. For Raman, the constraint is usually CCD pixel size rather than grating resolution: each pixel covers a finite wavelength range, often 0.1 nm or so. Match the grating dispersion to put resolvable features across multiple pixels.
When to use this calculator
**Use diffraction gratings for:**
- **Astronomical spectroscopy**: stellar classification, exoplanet detection, redshift measurement. - **Raman and fluorescence spectrometers**: chemical analysis, materials characterization. - **Mass spectrometer detectors with light-based readout**. - **DWDM (dense wavelength division multiplexing) telecom**: separate/combine ITU-grid channels. - **Wavelength meters for laser tuning**: high-precision wavelength determination. - **Atomic absorption spectrometers**: quantitative element analysis. - **CD/DVD/Blu-ray optical pickups**: actually use a tracking grating to separate light beams. - **Educational physics demonstrations**: visible-spectrum separation, interference pattern.
**Choosing a grating:**
- **Groove density**: higher = more dispersion but smaller useful spectral range. 600 lines/mm is the all-rounder. - **Blaze angle / blaze wavelength**: optimizes throughput in a specific order. Match to your operating wavelength. - **Substrate**: aluminum (visible), gold (NIR), MgF₂ (UV). - **Type**: reflection (most common), transmission (some specialty), holographic (low scatter, no shadows from ruling errors). - **Size**: bigger grating = more grooves N illuminated = higher resolving power.
**Order overlap problem:**
In second order, λ appears at the same angle as λ/2 in first order. For broad spectra, this causes overlap that confuses analysis. Solutions: order-sorting filters, cross-dispersion (echelle), or limit to first order only.
**Grating efficiency**:
- Ungrooved reflection grating: ~30% in first order, rest in other orders. - Blazed grating: 60–80% in optimized order at blaze wavelength. - Holographic grating: low ghosting and stray light, often 50–70% in first order. - Volume Bragg grating: near 100% diffraction efficiency at one specific wavelength and angle.
**Grating vs prism comparison:**
| Property | Grating | Prism | |---|---|---| | Dispersion | High, linear in angle | Lower, nonlinear | | Resolving power | High (R up to 10⁶) | Lower (R up to ~10⁴) | | Wavelength range | Wide | Limited by transmission | | Order overlap | Issue | None | | Brightness | Lower (light split into orders) | Higher (one beam out) | | Cost | Moderate to high | Generally lower |
Modern spectrometers almost always use gratings except in cases where prism advantages (brightness, no overlap) are crucial.
Common mistakes to avoid
- Confusing groove density units. Lines per mm, lines per cm, and lines per inch are all used in different contexts.
- Forgetting to convert wavelength to consistent units with d. Both must be in same length units (typically nm or µm).
- Using "average" angles for non-normal incidence. Always use the actual incidence angle α in the equation.
- Treating higher orders as more useful without considering efficiency drop. Higher m has lower throughput.
- Forgetting that "no diffraction" condition (|sin β| > 1) means that order doesn't exist for given λ, α, d.
- Overlapping orders without filters. The order-sorting filter is essential in broadband spectroscopy.
- Computing resolving power without considering pixel resolution at the detector. The actual instrument resolution is limited by the worse of grating R and detector sampling.
Frequently Asked Questions
Sources & further reading
Related Calculators
Angular Resolution Calculator
Calculate the diffraction-limited angular resolution using the Rayleigh criterion θ = 1.22λ/D.
Prism Dispersion Calculator
Calculate prism deviation angle, minimum deviation, and angular dispersion for optical prisms.
Raman Waveshift Converter
Convert between Raman shift (cm⁻¹), scattered wavelength (nm), and excitation wavelength for Raman spectroscopy.