Skip to content

Diffraction Grating Calculator

Updated:

Calculate the diffraction angle of a spectral line from its wavelength, grating line density and diffraction order. Enter the values and the calculator solves the grating equation and lists all observable orders.

Find the Diffraction Angle of a Spectral Line

Input Fields
λ
Wavelength of the light. Visible light spans roughly 380–750 nm.
N
Number of grooves (slits) per unit length. Typical gratings: 300–1200 lines/mm; a CD ≈ 625 lines/mm, a DVD ≈ 1350 lines/mm.
If enabled, the result will update automatically when you change any value.

Diffraction Grating Formula

Formula
\[ d\,\sin\theta = m\,\lambda, \qquad d = \frac{1}{N} \]

Where:

  • \(d\) — groove (slit) spacing of the grating (same length unit as \(\lambda\))
  • \(\theta\) — diffraction angle, measured from the grating normal (degrees)
  • \(m\) — diffraction order, an integer (0, 1, 2, …)
  • \(\lambda\) — wavelength of the light
  • \(N\) — grating line density, i.e. the number of grooves per unit length

The grating equation states that constructive interference occurs only at angles where the path difference between light from adjacent grooves equals a whole number of wavelengths. Because the spacing is the reciprocal of the line density, a denser grating (larger \(N\)) spreads the spectrum over wider angles.

Diffraction Grating – Calculation Example

Example: green light of wavelength 550 nm hits a grating with 600 lines/mm. At what angle does the first-order (m = 1) line appear?

\[ d = \frac{1}{N} = \frac{1}{600}\ \text{mm} = 1666.67\ \text{nm} \]

\[ \sin\theta = \frac{m\lambda}{d} = \frac{1 \times 550}{1666.67} = 0.33 \]

\[ \theta = \arcsin(0.33) = 19.27^{\circ} \]

Result: the first-order green line appears at θ ≈ 19.27° from the grating normal (and at −19.27° on the other side). The same grating shows this wavelength up to order m = 3, since \(d/\lambda = 3.03\).

How to Use the Diffraction Grating Calculator

  1. Enter the Wavelength (λ) of the light and choose its unit (nm, µm, Å or mm). Visible light is roughly 380–750 nm.
  2. Enter the Grating line density (N) — the number of grooves per length — and select lines/mm, lines/cm or lines/in. Typical lab gratings have 300–1200 lines/mm.
  3. Choose the Diffraction order (m) from the dropdown. Order 0 is the undeflected beam; higher orders are bent further from the normal.
  4. Read the Diffraction angle (θ) in degrees from the grating normal, along with the angle from the grating surface and the angle between the two symmetric ±m beams.
  5. Check the maximum observable order and the table of all orders to see the full angular distribution for this wavelength.

What Is a Diffraction Grating?

A diffraction grating is an optical component with thousands of equally spaced, parallel grooves (or slits) — typically only a few micrometres apart. When light passes through or reflects off the grating, each groove acts as a tiny secondary source. The waves from all the grooves interfere, and for most directions they cancel each other out. Constructive interference survives only at specific angles that satisfy \(d\sin\theta = m\lambda\), so each wavelength is sent into a small set of well-defined directions.

The result is that white light is split into a rainbow-like spectrum, one per diffraction order. Unlike a prism, which bends red light least, a grating bends longer wavelengths more, and the angular positions are predictable directly from the grating equation. This makes gratings the heart of spectrometers, monochromators and wavelength meters: measuring the angle at which a spectral line appears tells you its wavelength with high precision.

The order number \(m\) labels the successive interference maxima. Order 0 is the straight-through (or specularly reflected) beam, where all wavelengths overlap and no dispersion occurs. Higher orders deflect light further from the normal and spread the spectrum more widely, improving resolution — provided the order actually exists: since \(\sin\theta\) cannot exceed 1, an order is only observable when \(m\lambda \le d\). The calculator checks this automatically and reports the highest complete order \(m_{\max} = \lfloor d/\lambda \rfloor\), together with a table of every observable order and its angle.

Everyday examples are surprisingly common: a CD (≈ 625 lines/mm) and a DVD (≈ 1350 lines/mm) act as reflection gratings, which is why their surfaces shimmer in rainbow colours. Try entering these densities with a wavelength of 550 nm and compare the first-order angles.

Assumptions, Limitations and Practical Tips

  • Normal incidence: the calculator assumes the light hits the grating perpendicular to its surface. At oblique incidence the grating equation gains an extra term and the angles shift.
  • Ideal grating: groove spacing is treated as perfectly uniform and the angle is measured from the grating normal, as for a transmission grating (for reflection gratings the same geometry applies on the reflected side).
  • Maximum order: if the requested order requires \(\sin\theta > 1\), it simply does not exist. The error message tells you the highest order available for your wavelength and line density.
  • Overlapping orders: with broadband light, order m + 1 of a short wavelength can land at the same angle as order m of a longer wavelength (\(m\lambda\) is the same). Spectrometers use filters to remove the unwanted order.
  • Units matter: make sure the wavelength and the groove spacing are consistent — the calculator handles the conversions for you, but only a wavelength smaller than the groove spacing produces any diffracted orders.
  • Brightness: real gratings are often blazed to concentrate most energy into one chosen order; the equation gives the angles, not how bright each line is.

If you are working with the colour of thermal radiation instead of a monochromatic source, the Wien's Displacement Law calculator finds the peak wavelength of a hot object. For other angle-based physics problems, such as trajectories, try the projectile motion calculator.

Frequently Asked Questions

How do I calculate the diffraction angle by hand?

First find the groove spacing: \(d = 1/N\). For example, 600 lines/mm means \(d = 1/600\) mm = 1666.67 nm. Then compute \(\sin\theta = m\lambda/d\) and take the inverse sine: \(\theta = \arcsin(m\lambda/d)\). The result is the angle from the grating normal, not from the grating surface. A symmetric beam also appears at \(-\theta\) on the other side of the normal.

Why does the calculator say my order is not observable?

Because \(\sin\theta\) cannot exceed 1, the grating equation only has solutions when \(m\lambda \le d\). If you request an order that violates this, that diffraction maximum simply does not exist. The highest usable order is \(m_{\max} = \lfloor d/\lambda \rfloor\). Increase the groove spacing (fewer lines per mm) or use a shorter wavelength to reach higher orders.

How do I convert lines/mm, lines/cm and lines/in into groove spacing?

The groove spacing is the reciprocal of the line density, so 300 lines/mm gives \(d = 1/300\) mm ≈ 3.33 µm. For other units: 3000 lines/cm is the same as 300 lines/mm, and 1 line/in corresponds to 25.4 µm. Always express \(d\) in the same unit as the wavelength before using \(\sin\theta = m\lambda/d\) — the calculator does this conversion automatically.

What is a typical diffraction angle for visible light?

For common lab gratings (300–1200 lines/mm) and visible wavelengths (380–750 nm), first-order angles typically fall between about 10° and 30°. For instance, 550 nm light on a 1200 lines/mm grating appears near 41° in first order. Denser gratings and higher orders push the angles closer to 90°, where the spectrum spreads out more and resolution improves.

Why does a grating bend red light more than blue, opposite to a prism?

The grating equation \(d\sin\theta = m\lambda\) shows the angle grows with wavelength, so red light is diffracted further from the normal than blue. A prism relies on dispersion of the glass refractive index, which is stronger at short wavelengths, so it bends blue more. This reversed order is a quick way to tell whether a spectrum comes from a grating or a prism.

What is the zero order and why is it not dispersive?

Order m = 0 is the beam that passes straight through (or is specularly reflected) with \(\theta = 0\). Since \(m\lambda = 0\), the angle is the same for every wavelength, so all colours overlap and no spectrum is visible. The zero order is usually the brightest line but carries no wavelength information, which is why spectrometers work with higher orders.

Do overlapping orders cause problems in real measurements?

Yes. With broadband light, second-order violet can land at the same angle as first-order red because \(m\lambda\) is identical for both. In spectrometers this creates ghost or overlapping lines, so filters or order-sorting optics are used to block unwanted orders. When interpreting measured angles, always confirm which order you are actually observing before converting the angle to a wavelength.

Leave a Reply

Your email address will not be published. Required fields are marked *