The grating equation: a diffraction grating sends bright fringes only at angles where waves from every slit arrive in step — d·sinθ = nλ. This free calculator solves for the angle, the wavelength, the slit spacing (enter lines/mm directly) or the order, reports the highest visible order, and rejects impossible combinations where sinθ would exceed 1.
A grating is a row of many equally spaced slits. Light leaving neighbouring slits travels paths that differ by d·sinθ, and the waves reinforce only when that difference is a whole number of wavelengths — hence d·sinθ = nλ, with the integer order n counting the fringes outward from the centre. Everything about the pattern's geometry lives in that one equation.
Three steps: choose the quantity to solve for; enter the other three (the spacing accepts lines/mm as printed on real gratings — the calculator applies d = 1/N for you); read the answer with its worked steps. The result panel also reports nmax = floor(d/λ), the last order the grating can physically produce, because sinθ can never pass 1.
Two relationships to feel: a longer wavelength or a higher order pushes the fringe to a larger angle, while a finer grating (smaller d, more lines per millimetre) both widens the whole pattern and lowers nmax. That trade-off is why spectroscopists pick line densities to suit the band they study. You can watch all of it happen live in the interactive diffraction simulator, and the wavelength–frequency side of the story is covered by the wave speed calculator.
A grating marked 500 lines/mm has spacing d = 1 mm / 500 = 2.00 µm. For green light of λ = 550 nm in first order, sinθ = nλ/d = 550×10-9 / 2.00×10-6 = 0.275, so θ = arcsin(0.275) = 15.96°. The highest visible order is nmax = floor(2.00 µm / 550 nm) = 3: orders 1–3 appear each side of the central maximum, seven bright fringes in all. Reversing the measurement, a first-order fringe at 15.96° on the same grating gives back λ = d·sinθ = 2.00×10-6 × 0.275 = 550 nm.
Gratings are the working heart of spectrometers: they turn a wavelength measurement into an angle measurement you can make with a protractor. CD and DVD tracks, butterfly wings and holographic foils all act as reflection gratings, and astronomers read the composition of stars from grating spectra. The same equation, solved the other way, calibrates monochromators and laser wavelength meters.
The spacing d is the distance between adjacent slits. Enter it directly in micrometres or nanometres, or switch the unit to lines/mm and type the line density printed on the grating — the calculator converts it as d = 1/N. For example 500 lines/mm means d = 1 mm / 500 = 2.00 micrometres, and 1000 lines/mm means d = 1.00 micrometre.
Because the grating equation needs sinθ = n·λ/d, and a sine can never exceed 1. If the order times the wavelength is bigger than the slit spacing, that order simply does not exist — the light cannot bend past 90 degrees. The calculator flags this instead of returning an impossible angle, and tells you the highest order that does exist.
Count n_max = floor(d/λ) on each side of the centre. With d = 2.00 micrometres and green 550 nm light, d/λ = 3.6, so orders 1, 2 and 3 appear either side of the central maximum — seven bright fringes in total. A finer grating (smaller d) spreads the pattern wider but cuts the number of visible orders.
Set "Solve for" to the wavelength, then enter the grating line density, the order of the bright fringe you measured and its angle from the central maximum. The calculator returns λ = d·sinθ/n. This is exactly how a spectrometer measures spectral lines: with d = 2.00 micrometres and a first-order fringe at 15.96 degrees, λ = 550 nm.
No. This page solves the grating (multi-slit interference) equation d·sinθ = nλ, whose solutions are bright principal maxima. A single slit obeys a·sinθ = mλ, which locates dark minima of the diffraction envelope instead — the same-looking formula describes the opposite feature, so the two must not be mixed up.