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.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Reference formula  Standard diffraction grating equation, physics curriculum level.

1. Grating and Light

lines/mm
nm

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 Results

Grating Spacing (d)
1,666.7 nm
Distance between slits
Diffraction Angle
20.70 deg
For m = 1
sin(theta)
0.3534
m lambda / d
Maximum Order
2
Highest possible m

Diffraction Angles by Order

Order (m)sin(theta)Angle (theta)Status

Inputs Used

Lines per mm600 lines/mm
Grating spacing (d)1,666.67 nm (0.001667 mm)
Wavelength (lambda)589.0 nm
Order (m)1
Equationsin(theta) = m lambda / d

What This Means

d / lambda2.830
Max order possible2
Angle at m = 120.70 deg
Selected order valid?-
Summary: Enter your grating and wavelength values above.

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

SymbolMeaningTypical units
dDistance between adjacent slits (grating spacing)metres or nanometres
thetaAngle of diffraction, measured from the normal to the gratingdegrees or radians
mDiffraction order (an integer: 0, 1, 2, 3...)whole number
lambdaWavelength of the lightnanometres 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

Related Calculators

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.