# Diffraction Grating Calculator

URL: https://speedycalculator.com/calculators/physics/diffraction/
Last updated: 2026-10-30

> The diffraction grating calculator finds the angles of the first five diffraction orders for light of a given wavelength hitting a grating with a given line density and angle of incidence.

## Inputs

- Wavelength λ (nm, µm, mm, m, pm, Å)
- Grating density (lines/mm)
- Angle of incidence θᵢ (°, rad, arcmin, arcsec, mrad)

## Results

- Grating spacing d
- Order 1 angle
- Order 2 angle
- Order 3 angle
- Order 4 angle
- Order 5 angle

## Formula

```
d·(sin θ_m + sin θ_i) = m·λ,  d = 1/N
```

## Explanation

A diffraction grating – thousands of fine lines – splits light into its colours at precise angles. Spectrometers, CDs and the iridescence of some beetles all use this effect. The grating equation predicts where each wavelength appears.

### How to use the Diffraction Grating Calculator

- **Wavelength λ**
- **Grating density (lines/mm)**
- **Angle of incidence θᵢ**

Results update as you type, every field has its own unit menu, and everything is calculated in your browser.

### How it works

Enter the wavelength, the number of lines per millimetre and the angle of incidence (0° for light hitting the grating straight on). Orders that cannot exist show a dash.

### Tips

- Use the sign convention of the formula: real images and distances are positive in most lens equations.
- Wavelength units matter – nm for visible light, µm for infrared.
- Refractive index of air is about 1.000293; vacuum is exactly 1.
- Angles are measured from the normal to the surface.

### Common mistakes to avoid

- Measuring angles from the surface instead of the normal.
- Mixing focal length in mm and object distance in m.
- Forgetting that a diverging lens has a negative focal length.

### Inputs explained

FieldWhat to enterWavelength λUnits: nm, µm, mm, m, pm, ÅGrating density (lines/mm)A numberAngle of incidence θᵢUnits: °, rad, arcmin, arcsec, mrad

### Example values

How the main result changes when **Wavelength λ** changes and everything else stays at the example values above:

Wavelength λ (nm)Order 1 angle (°)2669.183739913.851153218.614666523.515779828.60711,06439.6726

## Worked example

Inputs — Wavelength λ: 532 nm; Grating density (lines/mm): 600; Angle of incidence θᵢ: 0 °.

Results — Grating spacing d = 1.66667 µm; **Order 1 angle = 18.6146 °**; Order 2 angle = 39.6726 °; Order 3 angle = 73.2557 °.

## Key terms

- **Grating equation**: d(sin θ_m + sin θ_i) = mλ.

## FAQ

**Why do higher orders disappear?**
When mλ/d exceeds 1, no real angle exists.

**How does line density affect the spread?**
More lines per mm spread the colours over larger angles.

**Why do CDs show rainbows?**
Their tracks act as a reflection grating with about 625 lines/mm.

**What is the zeroth order?**
The undeviated beam, containing all wavelengths.

**What formula does the Diffraction Grating Calculator use?**
d·(sin θ_m + sin θ_i) = m·λ,  d = 1/N.


## Sources

- [OpenStax – University Physics Volume 3](https://openstax.org/details/books/university-physics-volume-3)
- [HyperPhysics (Georgia State University)](http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html)
