Calculator
Use the grating equation for reflection or transmission setups. Provide spacing d or groove density, then solve for the missing quantity.
Formula used
A diffraction grating relates the wavelength, groove spacing, and angles by:
Grating equation: mλ = d( sinα + sinβ )
- m is the diffraction order (…, −2, −1, 0, 1, 2, …).
- λ is the wavelength of light.
- d is the groove spacing (inverse of line density).
- α is the incidence angle, and β is the diffraction angle.
When solving for β, the calculator checks the arcsine domain.
How to use this calculator
- Select what you want to solve for from the dropdown.
- Enter the known values with the correct units.
- Provide either spacing d or line density.
- Set α for oblique incidence, or keep it zero.
- Press Calculate to view the result above.
- Use the download buttons to export your results.
Example data table
| Lines (per mm) | Spacing d (nm) | Order m | Wavelength λ (nm) | α (deg) | β (deg) |
|---|---|---|---|---|---|
| 600 | 1666.7 | 1 | 532 | 0 | 18.61 |
| 600 | 1666.7 | 2 | 650 | 0 | 51.30 |
| 1200 | 833.3 | 1 | 405 | 0 | 29.10 |
These examples assume normal incidence and positive diffraction angles.
Article
1) What the grating equation describes
A diffraction grating creates bright directions where waves stay in step. The geometric condition is
mλ = d(sinα + sinβ). When it holds, order m forms a maximum at angle
β for wavelength λ. Larger |m| usually spreads colors farther apart.
2) Key terms: order, spacing, and angles
The order m is an integer (…−2, −1, 0, 1, 2…). The spacing d is the groove
pitch. Angles α (incidence) and β (diffraction) are measured from the normal.
With α = 0°, the equation becomes mλ = d·sinβ.
3) Groove density to spacing conversion
Gratings are often labeled by groove density N in lines/mm. Convert with
d = 1/N mm. Example: 600 lines/mm → d ≈ 0.0016667 mm = 1.6667 µm.
Common lab gratings include 300, 600, and 1200 lines/mm. Keep d and λ in compatible units.
4) Feasibility checks for real angles
A solution exists only if the computed sine stays in range. Rearranging gives
sinβ = mλ/d − sinα. If sinβ is outside −1 to 1, that order cannot occur
for the chosen inputs. The intermediate sine value helps with quick troubleshooting.
5) Typical wavelength ranges
Visible light is roughly 380–750 nm. Many spectrometers also work in UV below 380 nm and near‑IR above 750 nm. Enter values in nm, µm, mm, or meters; the calculator converts internally so 532 nm and 0.532 µm match.
6) Using nonzero incidence angles
Nonzero α is common in instruments to place a desired band on a detector. It shifts all orders
and can move a maximum into a practical angular window. Use a consistent sign convention for α and β so the
sinα + sinβ term matches your geometry.
7) Dispersion and resolution intuition
Higher groove density and higher order increase angular dispersion, which helps separate nearby wavelengths. Real resolution is limited by illuminated groove count, slit width, optics quality, and detector sampling. Higher orders can overlap in wavelength (order-sorting filters help). If the beam footprint grows, dispersion benefits, but alignment sensitivity increases.
8) Practical use cases
Use “solve for β” to predict where a laser line lands, or “solve for λ” to identify an emission peak from a measured angle. In astronomy and remote sensing, gratings map spectra to detectors to estimate composition, temperature, and Doppler shifts using carefully chosen groove densities and orders.
FAQs
1) What does m = 0 mean?
The zero order is the undeviated beam (specular direction). It contains all wavelengths mixed together, so it is bright but does not separate colors.
2) Why do I get “no real solution” sometimes?
It happens when the computed value for sinβ (or the equivalent term) falls outside −1 to 1. That combination of spacing, order, angle, and wavelength cannot produce a diffracted maximum.
3) How do I convert lines/mm to spacing?
Use d = 1/N in millimeters when N is lines per millimeter. The calculator can also convert d to micrometers or nanometers automatically.
4) Which side should I use for negative orders?
Negative orders appear symmetrically on the opposite side of the normal, depending on your sign convention. Use negative m (or negative β) to represent the mirrored direction.
5) Does blaze angle change the equation?
The basic grating equation stays the same. Blaze angle mainly shifts where efficiency peaks, making certain wavelengths brighter in a chosen order without changing the geometric condition for maxima.
6) What unit should I use for wavelength?
Any is fine as long as you choose it consistently. Many users prefer nanometers for visible light and micrometers for infrared. The calculator converts everything to meters internally for a consistent computation.
7) What is the maximum order I should try?
Start with ±1 and ±2. Higher orders may exist mathematically, but they often overlap with other wavelengths and can be weak. Feasibility depends on d, λ, and the angles.