Diffraction Calculator - Slit, Grating, Airy Disk
Use this diffraction calculator to solve d*sin(theta) = m*lambda for single-slit minima, diffraction grating maxima, and circular aperture Airy disk.
Diffraction Calculator
Results
What Is the Diffraction Calculator?
A diffraction calculator solves the relation d*sin(theta) = m*lambda for single-slit minima, diffraction grating maxima, and circular aperture (Airy disk) patterns in one tool. Choose the geometry, enter the wavelength and aperture parameters, and the calculator returns the diffraction angle in degrees, the on-screen position in metres, and the maximum order m_max that geometry allows.
- • Single-slit homework: Back out the slit width from a measured dark fringe position, or predict the dark fringe positions on the lab screen for a given slit.
- • Diffraction grating lab: Read the first- and second-order maxima for a 600 lines/mm grating with a He-Ne laser and check the textbook m_max rule.
- • Telescope resolution check: Use the circular aperture mode to find the Rayleigh-criterion angular resolution of a small telescope or camera lens.
- • Spectrometer calibration: Pick the right grating spacing and order to spread a known spectral line across a CCD or photographic plate.
Diffraction is what happens when a wavefront hits an obstacle and the waves bend around its edges. The bending is small when the obstacle is huge compared with the wavelength, but dominates when comparable - which is why diffraction sets the resolution limit of every microscope and telescope. Single-slit and grating patterns are the textbook examples; the Airy disk from a circular aperture is the practical case for real optical instruments. The calculator runs all three geometries from one set of inputs.
When the diffracting object is a periodic crystal lattice instead of an artificial grating, the Braggs Law Calculator handles the same kind of constructive-interference problem for X-ray, neutron, and electron beams.
How the Diffraction Calculator Works
The diffraction calculator implements three geometric conditions: the grating equation d*sin(theta) = m*lambda, the single-slit condition a*sin(theta) = m*lambda, and the Rayleigh criterion sin(theta) = 1.22*lambda/D for the first Airy minimum of a circular aperture. Pick the geometry from the dropdown and the same wavelength and spacing fields power all three modes.
- d or a (nm): Grating spacing d, or single-slit width a. A 600 lines/mm grating is 1666.67 nm.
- lambda (nm): Vacuum wavelength. He-Ne laser 632.8 nm, green laser 532 nm, sodium D-line 589.3 nm.
- theta (degrees): Diffraction angle from the central maximum. Reported in degrees with screen position in metres.
- m: Diffraction order. Central peak is m = 0, first off-axis peak is m = 1.
- D (mm): Diameter of a circular aperture, used only in Airy disk mode.
The pure function reads the diffraction-type selection, validates the wavelength and geometry parameters, and inverts the appropriate equation. For grating and single-slit modes it computes sin(theta) = m*lambda/d, clamps the ratio to [-1, 1] to keep the arcsine real, and reports theta in degrees. For circular apertures it uses sin(theta) = 1.22*lambda/D. The screen position is y = L*tan(theta), so the same result panel works for the lab screen and an optical bench measurement. The m_max = floor(d/lambda) row flags any over-large order that produces no real angle.
Helium-neon laser on a 600 lines/mm grating, first order
lambda = 632.8 nm, d = 1666.67 nm (1 / 600 mm), m = 1, L = 1.0 m
sin(theta) = 1 * 632.8 / 1666.67 = 0.3797, theta = arcsin(0.3797) = 22.31 degrees
theta = 22.31 degrees, y = 0.4107 m, m_max = 2
The first-order red dot on a 1-metre lab screen sits about 41 cm off the central beam. The same setup supports only first- and second-order peaks because m_max = 2 for red light on a 600 lines/mm grating.
Single-slit first dark fringe on a 0.10 mm slit at 2 m
lambda = 632.8 nm, a = 0.10 mm = 1e5 nm, m = 1, L = 2.0 m
sin(theta) = 1 * 632.8 / 1e5 = 6.328e-3, theta = arcsin(6.328e-3) = 0.3626 degrees
theta = 0.3626 degrees, y = 12.66 mm, m_max = 158
On a 2-metre lab screen the first dark fringe of a 0.10 mm red slit sits about 12.7 mm from the central peak, and a red laser will show 158 dark fringes before the pattern fades into the noise floor.
According to Wikipedia - Diffraction grating, a 600 lines/mm lab grating has a slit spacing of about 1.667 micrometres, which sets the characteristic angular scale for visible-light diffraction.
When the experiment switches from diffraction at a grating to refraction through a prism, the Angle of Refraction Calculator covers the Snell's-law side of the same intro-optics toolkit.
Key Concepts Explained
Four ideas make the calculator predictable: the path-difference geometry of the grating equation, the dark-fringe convention for single slit, the small-angle approximation for screen distances, and the Rayleigh criterion for circular apertures.
Path difference geometry
For a grating with spacing d, the path difference between adjacent slits is d*sin(theta). The grating equation is constructive interference when that path difference equals an integer number of wavelengths, d*sin(theta) = m*lambda.
Single slit dark fringes
For a single slit of width a, the m-th dark fringe appears at a*sin(theta) = m*lambda. The central bright fringe is roughly twice as wide as the others, the visual signature of single-slit diffraction.
Small-angle approximation
When theta is below about 10 degrees, sin(theta) and tan(theta) agree to within 1.5%, so y = L*tan(theta) is a safe conversion from angle to screen distance in metres.
Rayleigh criterion
The first dark ring of the Airy disk from a circular aperture of diameter D appears at sin(theta) = 1.22*lambda/D. The factor 1.22 comes from the first zero of the Bessel function J1 and sets the smallest detail a telescope can resolve.
The diffraction pattern is the spatial version of the same wave-superposition result that the Harmonic Wave Equation Calculator works through for two coherent sources at the same point.
How to Use This Calculator
Run the diffraction calculator in any of its three modes in under a minute. Each step is real-time, so changing the wavelength or spacing updates the angle, screen position, and m_max immediately.
- 1 Choose the diffraction geometry: Open the dropdown and pick Diffraction grating, Single slit minima, or Circular aperture Airy disk.
- 2 Enter the wavelength: Type the vacuum wavelength in nm. The default 632.8 nm is the He-Ne line; use 532 nm for green or 589.3 nm for sodium D.
- 3 Fill in the slit spacing or aperture: Type d in nm for a grating (a 600 lines/mm grating is 1666.67 nm) or a in nm for a single slit. In circular mode, type D in mm instead.
- 4 Pick the diffraction order: Type m as a positive integer. m = 1 is the default; higher orders sit at larger angles but are dimmer.
- 5 Set the screen distance: Type L from aperture to screen in metres. The default 1.0 m works for a typical optics bench.
- 6 Read the angle and screen position: The primary output is theta in degrees; the secondary rows show y in metres and m_max. Press Reset to restore defaults.
Switch the calculator to Diffraction grating, type lambda = 532 nm, d = 1666.67 nm, m = 1, L = 1.0 m. The result panel shows theta = 18.61 degrees, y = 0.3367 m, and m_max = 3, so a green laser gives three visible orders on a 600 lines/mm grating while a red laser gives only two.
When the same diffraction setup is paired with a curved mirror to focus the diffracted orders, the Mirror Equation Calculator covers the geometric-optic side of the same optics toolkit.
Benefits of Using This Calculator
A focused diffraction calculator gives you faster, more reliable answers than rebuilding three formulas in your head.
- • Three geometries in one tool: Switch between grating, single slit, and circular aperture modes without retyping the formula. The same wavelength and spacing fields power all three.
- • Reports both angle and screen position: The primary result is theta in degrees and the secondary row is y in metres, so you can read the lab screen directly.
- • Flags over-large orders automatically: The m_max row tells you the largest integer order geometry allows. Pick a larger m and the calculator warns you instead of producing a phantom angle.
- • Built-in worked examples: The default He-Ne laser values reproduce the textbook 600 lines/mm grating problem, and the worked single-slit example reproduces the lab-bench result.
- • Real-time recalculation: Change any input and every output updates immediately, the fastest way to see how a wavelength or aperture moves a peak.
When the same optics setup is paired with atomic spectroscopy, the Rydberg Equation Calculator covers the hydrogen-like spectral lines that identify which element is producing the light the calculator is diffracting.
Factors That Affect Your Results
Three experimental factors control whether the output matches what an optics bench records, and three limitations set the boundary of the formulas.
Wavelength choice
Shorter wavelengths pack more orders into the same angle range and resolve closely spaced lines. Red at 632.8 nm on a 600 lines/mm grating shows only two orders; green at 532 nm shows three.
Slit spacing and aperture diameter
A finer grating spreads the orders further apart, while a larger telescope aperture D shrinks the Airy disk and improves resolution.
Order m
Higher orders give larger angles and weaker intensity. Geometry sets m_max = floor(d / lambda), beyond which no real angle exists.
Small-angle approximation
For theta below about 10 degrees, y = L*tan(theta) is accurate to better than 1.5%. Beyond that, the exact tan(theta) the calculator uses stays valid.
Coherence length and source width
The formulas assume a monochromatic point source. A broadband source smears out the fringes, and a finite source size blurs the pattern.
- • The Fraunhofer formulas assume the screen is far enough that the diffracted waves are effectively plane waves. For nearby screens the Fresnel corrections matter.
- • The single-slit dark-fringe formula ignores the actual slit edges, including Fresnel diffraction near the geometric shadow and finite slit thickness.
- • The Rayleigh criterion is a rule of thumb, not a hard limit. Adaptive optics, lucky imaging, and interferometric techniques resolve features below 1.22*lambda/D at the cost of elaborate optics.
According to Wikipedia - Airy disk, the first dark ring of the diffraction pattern produced by a circular aperture of diameter D appears at sin(theta) = 1.22*lambda/D, which is the Rayleigh criterion for the smallest resolvable detail.
When the same light source is used in a reflection or refraction setup, the Angle of Incidence Calculator covers the geometric-optic side of the same optics toolkit.
Frequently Asked Questions
Q: What does a diffraction calculator compute?
A: It computes the diffraction angle theta and the on-screen position y for one of three geometries: a diffraction grating with d*sin(theta) = m*lambda, a single slit with a*sin(theta) = m*lambda, or a circular aperture with the Rayleigh criterion sin(theta) = 1.22*lambda/D. Pick the geometry from the dropdown, enter the wavelength and the parameters, and the result panel reports theta in degrees, y in metres, and the maximum order m_max.
Q: What is the diffraction grating equation?
A: The grating equation is d*sin(theta) = m*lambda, where d is the center-to-center spacing between adjacent slits, theta is the angle of the m-th order maximum from the central beam, m is the diffraction order, and lambda is the vacuum wavelength. For a 600 lines/mm grating with a He-Ne laser at 632.8 nm, the first-order maximum sits at theta = 22.31 degrees and the second order at theta = 49.41 degrees.
Q: How do you find the slit width from a single-slit pattern?
A: Measure the position y of the first dark fringe on the screen, divide by the screen distance L to get tan(theta), and solve a = m*lambda/sin(theta) for the slit width a. For m = 1 with red light at 632.8 nm and a 0.10 mm slit at a 2.0 m screen, the first dark fringe sits 12.66 mm from the central maximum and the calculator confirms the slit width is 0.10 mm.
Q: What is the Rayleigh criterion for circular apertures?
A: The Rayleigh criterion says the smallest resolvable angular separation between two point sources is sin(theta) = 1.22*lambda/D, where D is the aperture diameter. The factor 1.22 comes from the first zero of the Bessel function J1 that describes the Airy disk. A 50 mm telescope at 532 nm resolves about 7.4e-4 degrees, while a 200 mm telescope improves that to about 1.9e-4 degrees.
Q: When is the small-angle approximation valid for diffraction?
A: The small-angle approximation is accurate to better than 1.5% for theta below about 10 degrees, and to better than 0.5% for theta below 5 degrees. Below those angles sin(theta) and tan(theta) agree with the small-angle limit y = L*theta within the precision of a typical optics lab measurement, which is why the calculator's y = L*tan(theta) reproduces the textbook small-angle formula.
Q: What is the difference between Fraunhofer and Fresnel diffraction?
A: Fraunhofer diffraction treats the parallel-light limit where the observation screen is far enough that the diffracted waves are effectively plane waves, giving the clean d*sin(theta) = m*lambda pattern the calculator uses. Fresnel diffraction covers the near-field case where the screen is close enough that the wavefront curvature matters, and produces the more complicated Poisson spot and edge-diffraction patterns. A typical optics bench is set up for Fraunhofer diffraction, so the calculator's formulas match what an introductory lab measures.