Diffraction Grating Calculator

Diffraction Grating: Order Angles, the Highest Order, and What It Can Resolve

d sinθ = mλ gives you one angle at a time. The questions that actually get set are different: how many orders exist at all, which of them land on your screen, and whether this grating can split the sodium doublet. This page answers all four, and draws the fan of orders at their true angles.

Order angles, highest order and resolving power

Lines per millimetre in, degrees out
In lines per millimetre, which is how every grating is labelled — 300, 600 and 1200 lines/mm are the common school and laboratory rulings. The spacing d that goes into the formula is the reciprocal: 600 lines/mm means d = 1/600 mm = 1.6667 µm = 1666.7 nm. Taking the ruling itself as d is the single commonest mistake on this question and it is out by a factor of about a million. The spacing is shown below the answer so you can check it.
In nanometres. 589.0 nm is the sodium yellow doublet (589.00 and 589.59 nm), the classic grating source; a red helium–neon laser is 632.8 nm, a green pointer 532 nm, and the visible band runs roughly 380 to 750 nm. The field accepts 100 to 3000 nm so you can try ultraviolet and near infrared, where the physics is identical and your eye is not.
The order number m. m = 0 is the straight-through beam, at zero degrees for every wavelength at once, which is why the central spot of a white-light grating pattern is white. m = 1 is the first bright fringe either side, m = 2 the next, and so on. An order only exists while mλ ≤ d, so a fine grating has very few of them; the highest order available is shown below the answer, and asking for one above it makes the calculator say so rather than invent an angle.
In millimetres. This is the part that turns a grating from a protractor exercise into an instrument: the resolving power is R = mN where N is the number of lines actually illuminated, so widening the beam sharpens the lines. A 10 mm beam on a 600 lines/mm grating uses 6000 rulings. Masking the grating down to 1 mm throws away nine tenths of its resolving power while changing none of the angles.
The grating seen edge-on, with every order that exists drawn at its true angle. Orders beyond the highest one are simply absent, as they are in the laboratory. The blue ray is the order you asked for and the arc is its angle.
20.6954°Example

A 600 lines/mm grating, sodium light at 589.0 nm, first order, 10 mm of grating illuminated

Advertisement

One condition, and the two numbers it does not tell you

d sinθ = mλ  ·  d = 1/(lines per mm)  ·  mmax = ⌊d/λ⌋  ·  R = λ/Δλ = mN  ·  dθ/dλ = m/(d cosθ)
d
the grating spacing, which is the reciprocal of the ruling. A grating sold as 600 lines/mm has d = 1/600 mm = 1666.7 nm. Every other quantity on this page follows from it, and substituting 600 for d instead of 1/600 is the error that produces an answer of about a millionth of a degree
mmax = ⌊d/λ⌋
the highest order that exists. sinθ ≤ 1 forces mλ ≤ d. At 600 lines/mm and 589 nm, d/λ = 2.83, so you get m = 0, 1 and 2 on each side and nothing more. If d/λ is exactly a whole number that top order grazes along the grating surface at 90° and cannot be observed, which is why this page takes the largest integer strictly below d/λ
R = mN
the resolving power, where N is the number of lines your beam actually covers, not the number ruled on the glass. R = λ/Δλ sets the closest pair of wavelengths you can tell apart. Widening the beam or working in a higher order both raise it; masking the grating lowers it and leaves every angle unchanged
dθ/dλ
the angular dispersion: how far apart two nearby wavelengths are pushed. It grows with order and with 1/cosθ, so the second order spreads a spectrum more than twice as widely as the first. This is the quantity to quote when you are asked why a higher order gives a better spectrum despite being dimmer
the sodium test
the D lines at 589.00 and 589.59 nm are 0.597 nm apart and are the standard check on a grating. Splitting them needs R = 589/0.597 ≈ 987, so about a thousand illuminated lines in the first order. A 600 lines/mm grating does it with under 2 mm of beam — a prism of the same size does not come close

Worked example

A 600 lines/mm grating, sodium light at 589.0 nm, first order, 10 mm of grating illuminated
THE SPACING FIRST. 600 lines/mm means d = 1/600 mm = 1.6667×10−3 mm = 1.6667 µm = 1666.7 nm. Write it in nanometres and the wavelength stays in nanometres too, so the ratio is clean and no power of ten can go missing.
HOW MANY ORDERS EXIST. d/λ = 1666.7/589.0 = 2.830. Orders run to the largest whole number below that, so m = 0, 1 and 2 on each side — five spots altogether, and no third order at any angle. Checking this before you start saves you from solving for an order that is not there.
THE FIRST-ORDER ANGLE. sinθ = mλ/d = (1 × 589.0)/1666.7 = 0.35340, so θ = sin−1(0.35340) = 20.6954°. On a screen 1.00 m beyond the grating that spot sits tan(20.6954°) × 1000 = 377.8 mm off the axis — a long way, which is why grating work is done with a spectrometer telescope and a vernier rather than a ruler.
THE SECOND ORDER IS NOT AT TWICE THE ANGLE. sinθ2 = 2 × 589.0/1666.7 = 0.70680, giving θ2 = 44.9751°, not 41.4°. The sine is proportional to the order; the angle is not. Doubling the angle is the second commonest error here after mishandling d.
WHAT IT CAN RESOLVE. A 10 mm beam covers N = 600 × 10 = 6000 lines, so in the first order R = mN = 6000 and the smallest wavelength difference it can separate is Δλ = λ/R = 589.0/6000 = 0.0982 nm. The sodium D lines are 0.597 nm apart, six times that, so they are split easily — and the splitting on the screen is 1.32 arcminutes in the first order, rising to 3.48 arcminutes in the second.
CHECK IT BACKWARDS. Put θ = 20.6954° back in: d sinθ = 1666.7 × 0.35340 = 589.0 nm = 1 × λ. One whole wavelength of path difference between adjacent slits, which is the entire content of the condition.
Advertisement

Which orders exist, and where they land, for three common rulings

Gratingdd/λ at 589 nmOrders each sideθ first orderθ highest order
100 lines/mm10 000 nm16.98163.3766°74.6256°
300 lines/mm3333.3 nm5.66510.2061°62.0276°
600 lines/mm1666.7 nm2.83220.6954°44.9751°
1200 lines/mm833.33 nm1.41144.9751°44.9751°
1700 lines/mm588.24 nm1.000nonenone
2400 lines/mm416.67 nm0.710nonenone
Read the fourth column before you do any trigonometry. A finer grating spreads each order more widely — that is the point of it — but it spreads them so widely that the high orders run off the end of the available angles and vanish. At 1700 lines/mm the spacing has fallen to almost exactly the sodium wavelength, so d/λ = 1.00 and the first order would have to sit at 90°, flat along the grating; past that there is only the undeflected beam. Gratings of 2400 lines/mm are sold and are useful, but in the ultraviolet, not in yellow light. The last column also shows why the highest order is the one spectroscopists like: it is both the most dispersed and the one most likely to be too close to 90° to use.

The condition, the ceiling on the order, and the number that makes a grating an instrument

Every grating question starts with d sinθ = mλ, and most of them are decided before you reach it. The spacing d is the reciprocal of the ruling: a 600 lines/mm grating has d = 1/600 mm = 1666.7 nm. Get that step wrong and nothing downstream can be right, which is why the spacing is printed under the answer here in both nanometres and in wavelengths.

The condition says the path difference between light from adjacent slits is a whole number of wavelengths. That gives the same angles as Young’s two slits — but not the same pattern. With two slits the maxima are broad and the intensity slides smoothly between them. With N slits illuminated, every maximum is narrowed by roughly a factor of N, because away from the exact condition the N waves no longer cancel in pairs but in a ring, and a ring of N vectors closes much faster. The result is a set of hairline-sharp lines on a dark field. That narrowing is the whole engineering value of a grating.

There is a ceiling on the order, and it catches people out. sinθ can never exceed 1, so mλ can never exceed d. The highest order is d/λ rounded down, and at 600 lines/mm in sodium light that is 2. Ask for the third and there is no angle to find — not a large angle, not a complex one, simply none. A fine 2400 lines/mm grating has no visible orders in yellow light at all, which sounds like a defect until you remember it was made for the ultraviolet. If this page cannot give you an angle, that is why, and it says so.

The angle is not proportional to the order. The sine is. At 600 lines/mm the first order sits at 20.70° and the second at 44.98°, not at 41.39°. The same non-linearity is what makes the high orders so dispersive: dθ/dλ = m/(d cosθ) grows both with m and with 1/cosθ, so a second-order spectrum is spread more than twice as widely as a first-order one. It is also dimmer, and the orders of different wavelengths begin to overlap — the red end of the second order can land on top of the blue end of the third. Spectroscopists live with that trade; a student meeting it for the first time usually assumes they have made a mistake.

Where it goes wrong. Four places, in order of how often they cost marks. Taking the ruling as d, which is out by a factor of a million. Doubling the angle for the second order. Forgetting that the order might not exist. And masking the grating down to a narrow beam and then expecting full resolving power: R = mN counts only the lines the light actually crosses, so a 1 mm beam on a 600 lines/mm grating has N = 600 and R = 600 in the first order, which is not enough to split the sodium doublet that the same grating splits easily with a 10 mm beam. The angles do not change at all. Only the sharpness does, and sharpness is the thing you were measuring.

A grating also does something a prism cannot: its angles depend on nothing but geometry and the wavelength. A prism’s dispersion depends on the glass, varies non-linearly across the spectrum, and has to be calibrated against known lines. A grating’s condition is exact, so the wavelength you compute from a measured angle is a measurement rather than an interpolation. That is why the metre was once compared against a cadmium line with a grating, and why refraction and diffraction sit in different parts of the syllabus despite both bending light.

Frequently asked questions

What is the formula for a diffraction grating?

d sinθ = mλ, where d is the distance between adjacent slits, m is the order (0, 1, 2, …) and λ the wavelength. d is the reciprocal of the ruling: 600 lines per millimetre gives d = 1/600 mm = 1666.7 nm. The same relation is sometimes written with the ruling N as sinθ = mNλ, which is the same statement and a frequent source of confusion, because the N in that version is lines per metre while the N in the resolving power R = mN is the number of lines illuminated. They are different quantities with the same letter.

How many orders can a grating produce?

d/λ rounded down, because sinθ cannot exceed 1. At 600 lines/mm and 589 nm, d/λ = 2.83, so orders 0, 1 and 2 appear on each side and there is no third. If d/λ comes out as an exact whole number, that top order would sit at exactly 90° — grazing along the grating — and cannot be observed, so this page counts the largest integer strictly below d/λ. When d is smaller than λ there are no diffracted orders at all, only the straight-through beam.

Why is the second-order angle not twice the first-order angle?

Because the condition fixes the sine, not the angle. sinθ doubles; θ grows faster than that, because the sine function flattens. At 600 lines/mm in 589 nm light the first order is at 20.6954° and the second at 44.9751°. Doubling 20.6954° would give 41.3908°, which is wrong by three and a half degrees — easily enough to fail a comparison with a measured value.

What is the resolving power of a diffraction grating?

R = λ/Δλ = mN, where N is the number of grating lines the beam actually covers and m is the order. A 10 mm beam on a 600 lines/mm grating illuminates 6000 lines, so in the first order R = 6000 and the closest wavelengths it can separate at 589 nm are Δλ = 589/6000 = 0.098 nm apart. Masking the grating reduces N and therefore R, without moving any of the angles. This is the main practical difference between a grating and a prism of the same size.

Why is the central maximum white in white light?

Because m = 0 gives sinθ = 0 for every wavelength at once. Zero path difference is zero path difference whatever the colour, so all wavelengths are reinforced in the same direction and the straight-through spot stays white. Every other order has an angle that depends on λ, so the first and higher orders are spread into spectra with violet nearest the centre and red furthest out. It is also why a grating cannot be used to measure a wavelength in the zeroth order — there is no information in it.

Can a grating separate the two sodium D lines?

Usually yes, and it is the standard test. The lines are at 589.00 and 589.59 nm, 0.597 nm apart, so you need R = 589/0.597 ≈ 987 — about a thousand illuminated lines in the first order. A 600 lines/mm grating reaches that with less than 2 mm of beam. The angular separation is small: 1.32 arcminutes in the first order with this grating, which is why the splitting is seen through a telescope on a spectrometer and not with the naked eye on a screen.

Related calculators

References

  1. NCERT, Physics Textbook for Class XII, Part II, Chapter 10, Wave Optics (chapter text read 11 November 2026). Section 10.6 covers diffraction and section 10.6.1 the single slit, placing the minima at nλ/a. The rationalised chapter contains no treatment of the diffraction grating, no resolving-power formula and no 1.22λ/D criterion — its only statement about resolution is the qualitative remark in section 10.6 that the finite resolution of the eye and of telescopes is caused by diffraction. The numbered results it does carry are Eq. (10.13) and (10.14) for Young’s fringes. Worth knowing, because secondary sources routinely present the grating equation as though it were quoted from this chapter. Citing the chapter is not a claim that any board has approved this page. The copy read was a third-party mirror of the official PDF, not ncert.nic.in itself.
  2. Cambridge Assessment International Education, Cambridge International AS & A Level Physics 9702 syllabus for examination in 2025, 2026 and 2027 (read 11 November 2026). The syllabus document is the authority on what a CIE candidate is expected to recall, and it is the reason this page states the grating condition in the d sinθ = mλ form rather than the sinθ = mNλ form. Cited as the board’s own published document; no endorsement is implied.
  3. The International System of Units (SI), 9th edition, Bureau International des Poids et Mesures, 2019. The metre is defined by fixing the speed of light in vacuum at exactly c = 299 792 458 m/s, so a wavelength measured as an angle on a grating is traceable to the definition of the second and nothing else. That traceability is the reason gratings, rather than prisms, were used in the spectroscopic comparisons that preceded the present definition.
  4. D. C. Hoyt and colleagues, Values of Fundamental Physical Constants wall chart, NIST Physical Measurement Laboratory (2022 printing, read 11 November 2026). Used here only for the exact speed of light. The sodium D-line wavelengths of 589.00 and 589.59 nm quoted on this page are the conventional laboratory values given in school and undergraduate texts; they were not verified against a primary spectroscopic table for this page, and the 0.597 nm separation should be treated as the textbook figure rather than a measured one.