Skip to main content
physics

Diffraction Grating Calculator

Calculate diffraction angles using the grating equation d sin θ = mλ. Determine the angular positions of interference maxima for spectroscopy and optical analysis applications.

Reviewed by Christopher FloiedPublished Updated

This free online diffraction grating calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.

Minimum: 0

Results

Diffraction Angle

19.23°

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the Diffraction Grating Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.

2

Review your inputs

Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The Diffraction Grating Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

When to Use This Calculator

  • Use the Diffraction Grating Calculator when you need accurate results quickly without the risk of manual computation errors or unit conversion mistakes.
  • Use it to verify calculations made by hand or in spreadsheets — an independent check can catch errors before they lead to costly decisions.
  • Use it to explore how changing input parameters affects the output — a quick way to develop intuition and identify the most influential variables.
  • Use it when collaborating with others to ensure everyone is working from the same numbers and applying the same assumptions.

Related Calculators

About Diffraction Grating Calculator

The Diffraction Grating Calculator determines the angles at which constructive interference produces bright maxima when light passes through a periodic array of slits. Diffraction gratings are the workhorses of spectroscopy — they separate white light into its component wavelengths far more effectively than prisms. With thousands of slits per millimeter, gratings produce sharp, well-defined spectral lines. This technology enables astronomers to determine stellar compositions, chemists to identify substances, and engineers to characterize laser sources with extraordinary precision.

The Math Behind It

A diffraction grating consists of many parallel slits separated by distance d. When monochromatic light passes through, constructive interference occurs at angles where the path difference between adjacent slits equals an integer number of wavelengths: d sin θ = mλ. **Orders of diffraction**: m = 0 (straight through), m = ±1 (first order), m = ±2 (second order), etc. Higher orders appear at larger angles. Maximum order: m_max = floor(d/λ). **Resolving power**: R = mN, where N is the total number of slits. A grating with 5000 slits in first order can resolve wavelengths differing by 1/5000 of the wavelength — far exceeding prism capabilities. **Grating types**: 1. **Transmission**: Light passes through slits (like a fence) 2. **Reflection**: Light reflects off grooved surface (like a CD) 3. **Blazed**: Grooves angled to concentrate light in a preferred order, maximizing efficiency **Spectroscopy applications**: - Astronomy: Determining chemical composition, temperature, and velocity of stars - Chemistry: Absorption and emission spectra for elemental analysis - Telecommunications: Wavelength division multiplexing in fiber optics - CDs and DVDs: Act as reflection gratings, producing rainbow patterns **Angular dispersion**: dθ/dλ = m/(d cos θ). Higher orders and smaller slit spacings produce greater dispersion — better wavelength separation.

Formula Reference

Grating Equation

d sin θ = mλ

Variables: d = slit spacing, θ = diffraction angle, m = order, λ = wavelength

Worked Examples

Example 1: Green Light, First Order

d = 1.67 μm (600 lines/mm), λ = 550 nm, m = 1

Step 1:sin θ = 1 × 550/1000 / 1.67
Step 2:= 0.550 / 1.67 = 0.3293
Step 3:θ = arcsin(0.3293) = 19.22°

First-order maximum at 19.22°.

Example 2: Hydrogen Alpha Line

d = 1.67 μm, λ = 656.3 nm, m = 2

Step 1:sin θ = 2 × 656.3/1000 / 1.67
Step 2:= 1.3126 / 1.67 = 0.7859
Step 3:θ = arcsin(0.7859) = 51.82°

Second-order Hα line appears at 51.82°.

Common Mistakes & Tips

  • !Confusing lines per mm with slit spacing — d = 1/(lines per mm) in mm, then convert to μm.
  • !Forgetting that sin θ cannot exceed 1, limiting the maximum observable order.
  • !Not converting wavelength from nm to μm to match slit spacing units.
  • !Ignoring that higher orders may overlap with different wavelengths from adjacent orders.

Related Concepts

Frequently Asked Questions

Why are gratings better than prisms for spectroscopy?

Gratings provide higher resolving power (proportional to number of slits), work across all wavelengths uniformly, and produce linear dispersion. Prisms have higher efficiency for small wavelength ranges but non-linear dispersion.

Why do CDs show rainbow colors?

The spiral track on a CD acts as a reflection diffraction grating with spacing ~1.6 μm. White light diffracts at different angles for each wavelength, producing the characteristic rainbow pattern.

What limits the number of orders visible?

The condition sin θ ≤ 1 limits the maximum order to m_max = d/λ. For d = 1.67 μm and λ = 500 nm, m_max = 3.34, so only orders 0, ±1, ±2, ±3 are visible.

Embed this calculator on your site

Paste this snippet into your blog, course page, or documentation to drop a live, interactive Diffraction Grating Calculator into your page.

Free to embed — includes a link back to MegaCalc.