Photonica
Tool · Imaging and diffraction

Diffraction Grating Calculator

Where does each order leave a grating, how strongly does it spread wavelengths apart, and how fine a spectral detail can it resolve? The calculator takes the groove density, wavelength, incidence angle or the Littrow condition, and order, and reports the diffraction angle of every propagating order, the angular and linear dispersion, the resolving power for a given illuminated width, the resolution of a spectrometer with a given entrance slit, the free spectral range and the Littrow angle. Background: diffraction grating, external-cavity laser, and optical spectrum analyzer fundamentals.

Grating and light
Instrument
W sets the resolving power of the grating; F, the focal length of the camera optic, turns angular dispersion into millimetres at the detector. The slit is imaged onto the detector by a collimator of the same focal length, as in a Czerny-Turner spectrometer.
Presets
Angles are measured from the grating normal and are positive on the side of the incident beam, so the equation reads mλ = d(sin α + sin β) with d the groove period (the convention of Palmer’s Diffraction Grating Handbook). The same equation holds for a transmission grating with β measured on the far side. The tool gives directions, dispersion and resolution; how much power reaches each order depends on the groove profile and polarization and is not modelled.
Readouts
order mβ (°)dispersion (°/nm)
Incident beam and diffracted orders
incident beamset orderother ordersgrating normal
Diffraction angle versus wavelength
Learn with it

Three short experiments. Each one sets the inputs, says where to look, and asks for a prediction before it shows the result.

Checked against

These checks run in your browser on every load. The angles are compared with values worked out by hand, each computed angle is put back into the grating equation, and the analytic dispersion is compared with a numerical derivative of the diffraction angle.

CheckExpectedComputedTolerance

The expected values are the grating equation and its derivatives as given in Palmer, Diffraction Grating Handbook, chapter 2, evaluated by hand for the stated gratings. The tolerance is the largest relative difference from Expected that still passes.

The model

Light of wavelength λ\lambda meeting grooves of period dd at incidence angle α\alpha is diffracted into the angles β\beta for which the waves from neighbouring grooves differ in path by a whole number mm of wavelengths:

mλ=d (sin⁡α+sin⁡β)m\lambda = d\,(\sin\alpha + \sin\beta)

Both angles are measured from the grating normal and are positive on the side of the incident beam. An order propagates only while ∣mλ/d−sin⁡α∣≤1|m\lambda/d - \sin\alpha| \le 1. At fixed incidence, differentiating gives the angular dispersion, and a camera of focal length FF turns it into a reciprocal linear dispersion at the detector:

dβdλ=mdcos⁡β,dλdx=dcos⁡βmF\frac{d\beta}{d\lambda} = \frac{m}{d\cos\beta}, \qquad \frac{d\lambda}{dx} = \frac{d\cos\beta}{mF}

With NN grooves illuminated, the resolving power and the free spectral range of order mm are

R=λδλ=∣m∣N=W(sin⁡α+sin⁡β)λ,FSR=λ∣m∣R = \frac{\lambda}{\delta\lambda} = |m|N = \frac{W(\sin\alpha + \sin\beta)}{\lambda}, \qquad \mathrm{FSR} = \frac{\lambda}{|m|}

so at given angles the resolving power depends only on the illuminated width WW. In the Littrow arrangement the diffracted order returns along the incident beam, α=β=θL\alpha = \beta = \theta_L, with

sin⁡θL=mλ2d,dβdλ=2tan⁡θLλ\sin\theta_L = \frac{m\lambda}{2d}, \qquad \frac{d\beta}{d\lambda} = \frac{2\tan\theta_L}{\lambda}

These are the directions and spreads of the orders. How much power each order carries depends on the groove profile, blaze angle and polarization, and needs electromagnetic theory; the tool does not model it. The resolving power is the ideal value for a perfect grating filled by a plane wave; ruling errors, a partly filled aperture and the slit and pixel widths of a real spectrometer reduce what is reached.

In a spectrometer whose collimator and camera have the same focal length FF, as in the Czerny-Turner layout, an entrance slit of width ww is imaged w\coslpha/\coseta wide, and multiplying by the reciprocal linear dispersion gives the slit-limited bandpass

\Delta\lambda_{\mathrm{slit}} = rac{w\,d\coslpha}{|m|F}

The calculator reports the larger of this and λ/R\lambda/R as the resolution. Both are estimates to within a factor of order one: the exact figure depends on how the line shape is defined, and a detector whose pixels are wider than the slit image, or aberrations of the optics, set a further limit that the tool does not include.

Worked example

A 600 line/mm grating has a period of 1.667 µm. At normal incidence with HeNe light at 632.8 nm the first order leaves at arcsin⁡(0.37968)=22.31∘\arcsin(0.37968) = 22.31^\circ and the second at 49.41°; a third order would need sin⁡β=1.139\sin\beta = 1.139 and does not exist. The first-order dispersion is 0.03716°/nm, or 0.6486 mrad/nm, so a 300 mm camera spreads the spectrum at 5.140 nm per millimetre of detector. Illuminated over 50 mm the grating has 30,000 grooves in the beam and can resolve lines 21.09 pm apart in first order. As a spectrometer with a 50 µm slit and 300 mm optics, its bandpass is 0.2778 nm, so the slit, not the grating, sets the resolution. The same grating in first-order Littrow at this wavelength would sit at 10.94°.

References: C. Palmer, Diffraction Grating Handbook, 8th ed., MKS Instruments (2020), chapter 2. E. Hecht, Optics, 5th ed., Pearson (2017). M. Born and E. Wolf, Principles of Optics, 7th ed., Cambridge University Press (1999).