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.
Shine light of one wavelength through a diffraction grating and watch the bright spots (orders) land on the screen exactly where d sin θ = mλ predicts.
About the Diffraction Grating & Spectrometer Lab
Free 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. Drag, change the sliders and see the result live. No sign-up, works on phone and computer. Built for physics, the diffraction grating & spectrometer lab runs instantly in your browser: change a setting or drag an object and the result updates at once, so you learn by trying things out rather than only reading about them.
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. Use it to explore physics ideas at your own pace, then check what you found against the key ideas further down this page.
How to use the Diffraction Grating & Spectrometer Lab
- Use the controls to change Grating lines per mm (N), Wavelength λ, Screen distance. The simulation reacts instantly.
- Press "Reset to defaults", "Lab Report" to start, reset or change what is happening.
- Where you see a glowing handle, object, weight or atom, drag it with your mouse or finger. Everything responds in real time.
- Watch the readouts and graphs update as you experiment, and compare what you see with the key ideas below.
Things to try
- 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.
- Check whether the 2nd and 3rd order challenge orders actually overlap.
Key ideas you can learn
- 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.
- Higher orders of a shorter wavelength can land at the same angle as a lower order of a longer wavelength, causing spectral overlap in real instruments.
Show my work
Challenges
Challenge 1 - aim the first order at exactly 30°
Keep λ = 600 nm. Using d sinθ = mλ with m = 1 and θ = 30°, find the required grating spacing d in nanometers, convert it to lines per millimeter (N = 10⁶ / d in nm), and set the slider to that value.
Challenge 2 - comparing two orders
With the grating spacing set to 500 lines/mm (d = 2000 nm), compute the first-order angle for 450 nm light and the second-order angle for 700 nm light (θ = arcsin(mλ/d)). Enter the difference θ(m=2, 700nm) − θ(m=1, 450nm) in degrees.
Where this is used in the real world
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.
Who is this simulation for?
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. It works well for flipped classrooms because students can explore before the lesson.
For teachers: project it on the board, let students predict what will happen, then run it together. For students: change one thing at a time and write down what changes.
Frequently asked questions
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. It is completely free, with no signup, no download and no ads inside the simulation. It runs in your web browser.
Does the Diffraction Grating & Spectrometer Lab work on a phone or tablet?
Yes. It uses touch as well as the mouse, so you can drag objects with your finger. A larger screen makes the controls easier to see.