Diffraction Calculator
See an Airy disk on a Bayer sensor and calculate aperture from pixel size, sensor format and light color.
Published
Light meets the pixel grid
Explore diffraction on a Bayer sensor
Choose a sensor, then slide the aperture to see light spread across its pixels. Select a pixel criterion to calculate your diffraction threshold.
RGGB filter pattern. The dashed circle marks the Airy disk’s first dark minimum; glow and outer rings are illustrative.
This camera uses X-Trans filters. The Bayer pattern shown is illustrative; pixel pitch and diffraction calculations still use the selected camera’s dimensions.
The Airy disk extends beyond this 20 µm crop.
- Pixel size / pitch
- 6.00 µm
- Airy disk at selected aperture
- 11.94 µm · 1.99 pixels
Selected 2-pixel criterion; diffraction increases gradually below and above this value.
2 pixels: a stricter criterion for very sharp lenses.
Why allow 3 pixels for a less sharp lens?
A lens that already blurs fine detail through optical imperfections may make extra diffraction harder to notice. That can justify a more forgiving threshold. Stopping down can also reduce those imperfections while increasing diffraction.
But a cheap lens does not need a 3-pixel disk. At the same aperture and wavelength, the ideal diffraction disk is the same size regardless of lens price. Choosing 3 pixels simply accepts more diffraction blur; it does not predict the lens’s sharpest aperture.
Read the example below ↓Each colored square is one photosite, not a complete RGB pixel. The same physical crop stays in view, so smaller pixels show more squares.
Formula & assumptions ↓How this calculator works
Changing the known camera, sensor format, resolution or pixel criterion moves the aperture slider to the calculated threshold, rounded to the nearest 0.1 f-number. Changing light color keeps the aperture fixed, so you can see how the disk changes with color. Click the calculated aperture value to move the slider to that threshold, or move aperture manually to explore the disk size. The slider stops at f/22; any higher calculated threshold is still shown in the result.
The light-color slider blends continuously from red through yellow to green, then through cyan to blue. Green has a slider stop and a clickable label to return to it exactly. The aperture slider runs from f/1 to f/22 and changes the disk drawn on the sensor in real time, with its actual diameter shown in µm and pixels. The 2 / 2.5 / 3-pixel criterion separately sets the aperture displayed under “Diffraction Occurs above”. This label means the selected pixel criterion is exceeded above that f-number; diffraction itself increases gradually and is present below it too.
The calculator estimates the diameter of the central Airy disk, from the first dark minimum on one side to the first dark minimum on the other. For an ideal circular aperture:
Airy disk diameter (µm) ≈ 2.44 × wavelength (µm) × f-number.
Pixel pitch is estimated as √(sensor width × sensor height ÷ megapixels) in µm when sensor dimensions are in mm. The target diameter is the chosen pixel count times that pitch. The calculator then solves for the f-number; the result is continuous and may fall between your camera’s aperture settings.
The formula comes from Edmund Optics’ explanation of the Airy disk and diffraction limit.
Choosing a pixel criterion
- 2 pixels is a stricter criterion for very sharp lenses.
- 2.5 pixels offers a middle ground.
- 3 pixels accepts more diffraction blur. This may be a useful tolerance for a less sharp lens whose optical imperfections already obscure fine detail, but it is not a rule for cheap lenses.
These are useful comparison choices, not measured lens ratings or hard boundaries where diffraction begins. Diffraction grows gradually as you stop down. Allowing a larger disk does not improve a lens; stopping down can reduce aberrations while increasing diffraction, so the best aperture depends on the lens and how you view the image.
Why does lens sharpness matter?
There are two different sources of softness here. Diffraction spreads light because it passes through a finite aperture. Aberrations are optical imperfections that prevent the lens from bringing light to the same ideal focus. At the same f-number and wavelength, the ideal Airy disk has the same diameter regardless of whether the lens is cheap or expensive. A real lens’s total blur also includes its aberrations; the disk drawn here shows only the ideal diffraction contribution.
On a very sharp lens, diffraction can become a visible limitation while fine detail is still well preserved, so a stricter 2-pixel criterion may be useful. If aberrations already obscure that detail, the additional loss from diffraction may be harder to see. That is the reasoning for trying a more forgiving 3-pixel criterion. It is a tolerance choice, not a measured property of that lens. See Edmund Optics on real lens performance versus the diffraction limit.
Example: with 6 µm pixels and green light at 550 nm, a 2-pixel disk is 12 µm across at approximately f/8.9. A 3-pixel disk is 18 µm across at approximately f/13.4. Switching to 3 pixels just says, “I am willing to accept that larger diffraction disk.” It does not establish that f/13.4 produces a sharper photograph.
Stopping down may improve an aberration-limited lens while diffraction grows, but this calculator does not model that tradeoff. To find the sharpest aperture, compare photographs at nearby apertures using your lens, focal length, focus distance and intended viewing size. Price alone does not tell you which criterion to choose; if unsure, start at 2 pixels and use 3 to explore a more tolerant limit.
Assumptions and limits
Choose a known camera to fill in its manufacturer-listed sensor dimensions and effective still-image megapixel count. A source link appears with each preset. Changing sensor format or resolution switches back to custom settings. Camera presets estimate pixel pitch from area and effective pixel count; they do not use a measured photosite pitch.
Sensor dimensions are nominal format presets. Resolution means total photosites, with square pixels covering the full sensor area; active dimensions and actual pixel pitch can differ by camera. One Bayer photosite samples one color, and the RGGB mosaic has two green filters for every red and blue filter. A two-photosite diameter does not imply two fully resolved RGB pixels.
Red (650 nm), green (550 nm) and blue (450 nm) are representative wavelengths, not the full spectral response of a color filter. Between these positions, the displayed color combines adjacent RGB channels (red + green appears yellow; green + blue appears cyan), with brightness normalized for visibility. For the diameter and aperture calculation, mixed positions use an interpolated wavelength estimate. A real mixture contains multiple wavelengths and would produce overlapping diffraction patterns of different sizes; this preview does not simulate that full optical response. The geometry and diameter use the stated model; the glow and outer rings are illustrative. This model omits lens aberrations, optical low-pass filters, demosaicing, sharpening and macro working-aperture effects.
Explore aperture alongside shutter speed and ISO in the Exposure Triangle, or compare telephoto lenses and teleconverters.