Explore the Diffraction Grating & Spectrometer Lab
Shine light through a diffraction grating and watch the bright orders land exactly where d sinθ = mλ predicts, then try to overlap two colors' orders.
- Free to use
- No signup
- Nothing to install
- Runs in your browser
Illustration. Open the tool for the real thing.
See it in action
The Diffraction Grating & Spectrometer Lab with sample data entered and the result showing.

What is the Diffraction Grating & Spectrometer Lab?
Shine light through a diffraction grating and watch the bright orders land exactly where d sinθ = mλ predicts, then try to overlap two colors' orders. It runs in your browser, so a change to a setting or a drag on an object shows up at once.
Diffraction gratings are the heart of spectrometers used to identify elements in stars, analyze chemical samples in labs, and separate wavelengths in optical instruments and telecom equipment.
3 steps to your result
Open the tool and follow along. Nothing to install.
What you get
The grating equation d sinθ = mλ predicts exactly where each bright order (m = 0, ±1, ±2, ...) lands for a grating with line spacing d.
A grating with more lines per millimeter has a smaller spacing d, which spreads the orders out to larger angles for the same wavelength.
Different wavelengths diffract by different amounts, which is how a grating spectrometer separates white light (or a star's light) into a spectrum.
Set 500 lines/mm and find the first-order angle for red versus violet light.
Increase lines per mm and watch the orders spread further apart.
Try the 30-degree first-order challenge.
Used for
Pick one to see how it fits.
Physics learners
Physics students in middle school, high school and first-year university, teachers who want a quick demonstration for the projector, and anyone revising for exams.
Try it freeTeachers
For teachers: project the Diffraction Grating & Spectrometer Lab on the board, let students predict the result, then run it together and test this: Increase lines per mm and watch the orders spread further apart. For students: change one thing at a time and write down what changes.
Try it freeHow it compares
A plain look at this tool next to the usual alternative.
| This simulation | Textbook diagram | |
|---|---|---|
| Interactive | Drag, tap and change settings | Fixed picture |
| Install | Nothing to install | Not needed |
| Cost | Free to use | Depends on the book |
Questions people ask
Why does a finer grating (more lines per mm) spread colors out more?
A finer grating has a smaller line spacing d, and since sinθ = mλ/d, a smaller d means a larger angle is needed to satisfy the grating equation for the same wavelength and order.
Why can a grating spectrometer show overlapping colors at high orders?
Because mλ is what determines the angle, a large m with a short wavelength can give the same product - and therefore the same angle - as a smaller m with a longer wavelength, so their orders land on top of each other.
Is the Diffraction Grating & Spectrometer Lab free to use?
Yes. The Diffraction Grating & Spectrometer Lab is free, needs no signup or download and runs in your web browser. It is part of the Physics group of AZRS simulations.
Does the Diffraction Grating & Spectrometer Lab work on a phone or tablet?
Yes. The Diffraction Grating & Spectrometer Lab takes touch input as well as mouse input, so you can use its 3 adjustable settings with a finger. A larger screen makes the controls and graphs easier to read.
How do I use the Diffraction Grating & Spectrometer Lab?
1. In the Diffraction Grating & Spectrometer Lab, use the controls to change Grating lines per mm (N), Wavelength λ, Screen distance. The simulation reacts instantly. 2. Start with this experiment: Set 500 lines/mm and find the first-order angle for red versus violet light. Drag any glowing handle, object or slider with your mouse or finger and the Diffraction Grating & Spectrometer Lab responds in real time. 3. Change one setting at a time and watch which readout moves, then compare it with this idea: The grating equation d sinθ = mλ predicts exactly where each bright order (m = 0, ±1, ±2, ...) lands for a grating with line spacing d.
More free tools
Related to the Diffraction Grating & Spectrometer Lab.
Try the Diffraction Grating & Spectrometer Lab now
Shine light through a diffraction grating and watch the bright orders land exactly where. Free to use.
Try it free