Diffraction Grating Calculator
This calculator works out where a diffraction grating sends light, using the standard diffraction equation d sin(theta) = m lambda. It suits physics students and anyone checking spectroscopy or interference calculations who needs the diffraction angle, grating spacing, or maximum usable order for a given grating and wavelength. Enter the grating's line density in lines per millimetre, the wavelength of light in nanometres (or pick a preset such as sodium D-line, green laser, or red HeNe laser), and the diffraction order you want to check, from the central maximum (m = 0) upward. The calculator converts your line density into grating spacing automatically, then returns the diffraction angle for that order, sin(theta), and the highest order the grating and wavelength combination can physically produce before sine would need to exceed 1. It also lists the angle and visibility of every order up to that maximum in a table, so you can see the full fringe pattern at a glance, plus a plain-language summary of whether your chosen order is achievable. Use it to plan or check practical spectroscopy work, verify NCEA or university physics problems on gratings and interference, or see how changing line density or wavelength shifts the fringe pattern. The results assume normal incidence and an ideal transmission grating, so treat them as a guide for coursework rather than a substitute for your own working.
1. Grating and Light
2. Diffraction Order
The calculator also shows the highest order this grating and wavelength combination can physically produce, and the diffraction angle for every valid order up to that maximum.
Diffraction Angles by Order
| Order (m) | sin(theta) | Angle (theta) | Status |
|---|
Inputs Used
What This Means
The Diffraction Grating Equation
A diffraction grating is a piece of glass or plastic etched with thousands of closely spaced parallel lines (slits). When light passes through the grating, each slit acts as a source of secondary wavelets. These wavelets interfere with each other, producing bright fringes (maxima) at specific angles and darkness everywhere else. The angles at which bright fringes appear are given by the diffraction grating equation:
d sin(theta) = m lambda
| Symbol | Meaning | Typical units |
|---|---|---|
| d | Distance between adjacent slits (grating spacing) | metres or nanometres |
| theta | Angle of diffraction, measured from the normal to the grating | degrees or radians |
| m | Diffraction order (an integer: 0, 1, 2, 3...) | whole number |
| lambda | Wavelength of the light | nanometres or metres |
Finding Grating Spacing from Lines per mm
Diffraction gratings are usually specified by how many lines are ruled per millimetre, rather than by the spacing itself. To find d, take the reciprocal of the line density: d = 1 / N, where N is the number of lines per millimetre. For example, a grating with 600 lines/mm has a spacing of d = 1/600 mm, which is approximately 1666.7 nanometres. This calculator performs that conversion automatically.
Working Out the Diffraction Angle
Once you know d, lambda, and m, rearrange the equation to solve for theta:
theta = arcsin(m lambda / d)
Because sine can only take values between -1 and 1, this equation only has a solution while m lambda / d is less than or equal to 1. This sets a natural limit on how many diffraction orders are physically possible for a given grating and wavelength. The maximum order is found by rounding d / lambda down to the nearest whole number.
Worked Example
Using a grating with 600 lines/mm and light of wavelength 589 nm (the sodium D-line) at first order (m = 1): the grating spacing is d = 1/600 mm = 1666.67 nm. Applying the equation, sin(theta) = (1 x 589) / 1666.67 = 0.3534, which gives theta = arcsin(0.3534) = approximately 20.70 degrees. The maximum order for this combination is d / lambda = 2.83, rounded down to 2, so only the zeroth, first, and second order maxima are visible.
Common Applications
- Spectroscopy: gratings split light into its component wavelengths for identifying elements and compounds.
- Physics practicals: measuring the wavelength of laser light or sodium lamps using a known grating.
- Optical instruments: monochromators and spectrometers use gratings to select specific wavelengths.
- CD and DVD surfaces: the closely spaced tracks act as a reflection grating, producing the rainbow effect you see when light reflects off a disc.
Related Calculators
- Maths and Stats Calculators: the full hub of maths and science tools.
- Wavelength Calculator: convert between wavelength, frequency and speed.
- Snell's Law Calculator: refraction angles between two media.
- Angle of Incidence Calculator: reflection and refraction angles.
- Wave Speed Calculator: work out wave speed from frequency and wavelength.
Sources: Standard diffraction grating equation as taught in NCEA and university-level physics (d sin theta = m lambda). Method consistent with NZQA physics curriculum materials and standard optics textbooks.
This calculator applies the standard diffraction grating equation for normal incidence (light hitting the grating straight on). It assumes an ideal transmission grating and does not account for grating imperfections, oblique incidence, or intensity variation between orders. For coursework, always check your specific question's assumptions.