Skip to content
Calc.

Diffraction Grating Calculator

Find the angle of each diffraction order from a grating with d sin θ = mλ. For a grating sold by lines per mm, enter d = 1,000,000 ÷ lines per mm (in nm).

Last updated: September 2026

Diffraction Angle

33.37 °

Formula below · 2 sources (openstax.org, hyperphysics.gsu.edu) · Updated Sep 2026

Compare with similar

About this calculator

A diffraction grating has many equally spaced lines. Light leaving neighbouring lines adds up in step only at angles where the path difference is a whole number of wavelengths, which gives the grating equation (light hitting the grating straight on):

d × sin θ = m × λ

d is the line spacing, m the order (0, ±1, ±2, …) and λ the wavelength, with d and λ in the same unit. With the defaults (550 nm, d = 1000 nm, m = 1): sin θ = 0.55, θ = 33.37°.

Lines per millimetre

Gratings are usually sold by line density. Enter d in nm = 1,000,000 ÷ (lines per mm); the tile shows the line density back. For example, a 600 lines/mm grating has d = 1666.7 nm and sends a 632.8 nm HeNe beam to 22.31° in first order and 49.41° in second.

Which orders exist

sin θ cannot exceed 1, so only orders with m ≤ d ÷ λ exist; the tile shows the highest one. Larger orders and finer gratings spread colours further apart, which is why spectrometers use dense gratings. The zero order (m = 0) goes straight through and does not separate colours.

How to use

Enter the wavelength and the line spacing in nm, and the order. Example 1: 532 nm green laser, d = 1500 nm, m = 1. sin θ = 532 ÷ 1500 = 0.3547, θ = 20.77°. Example 2: 632.8 nm on a 600 lines/mm grating, m = 2. Enter d = 1666.7 nm; sin θ = 2 × 632.8 ÷ 1666.7 = 0.7594, θ = 49.41°. Example 3: 550 nm, d = 1000 nm, m = 2. 2 × 550 ÷ 1000 = 1.1 > 1, so the second order does not exist.

Frequently asked questions

What does it mean when an order does not exist?

The grating equation needs sin θ = mλ/d, and a sine can be at most 1. If mλ/d is larger than 1, no angle satisfies it and that order is not produced. Use a coarser grating (larger d, fewer lines per mm) or a lower order.

How do I convert lines per mm to grating spacing?

d (nm) = 1,000,000 ÷ lines per mm. 300 lines/mm is 3333 nm, 600 lines/mm 1667 nm, 1200 lines/mm 833 nm. Enter that spacing here.

Why is the zeroth order not useful for spectroscopy?

At m = 0 the angle is 0 for every wavelength, so all colours leave together. Only orders 1, 2, … spread the colours out.

Does the angle of the incoming light matter?

Yes. This calculator assumes light hits the grating straight on. For an incidence angle θᵢ the equation becomes d(sin θᵢ + sin θₘ) = mλ.

Related calculators

Sources & references

How we check our calculators

Think a result is wrong? Report a problem with this calculator.