Skip to main content

Advanced Depth of Field (DoF) Calculator

Computes near, far, total DoF, hyperfocal distance, magnification, and field of view from focal length, aperture, subject distance, and sensor preset. Diffraction analysis adds Airy disk diameter at the chosen wavelength (default 550 nm), the diffraction-limited aperture, and effective resolution after combining pixel pitch and diffraction. A focus-stacking planner outputs each focus distance at a configurable overlap, and CoC method switches between Standard (diag/1500), Zeiss (diag/1730), or manual.

Runs entirely in your browser

This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.

Optics
Imaging
Camera Settings
Diffraction
Loading the tool
Reference

Documentation

Depth of field with diffraction awareness combines sensor specifications, focal length, aperture, and subject distance into a single analysis. Hyperfocal distance, Airy disk diameter, effective megapixels, and front-to-back distribution all come from that same set of inputs, which is what makes focus stacking sequences and aperture comparisons possible in one view.

  • Sensor and film format presets carry sensor dimensions and a typical megapixel count, used to compute pixel-level sharpness; a custom entry accepts sensor width, height, megapixels, and an optional circle of confusion value.
  • Focal length is entered in millimeters, accepting fractions, mixed numbers, decimals, and scientific notation.
  • Aperture is entered as an f-stop number, and the diffraction analysis flags whether the chosen aperture exceeds the diffraction-limited aperture for the sensor.
  • Results report the standard depth-of-field metrics: near limit, far limit, total depth of field, hyperfocal distance, magnification, horizontal field of view, and front-to-back distribution.
  • Diffraction analysis reports the Airy disk diameter at the current aperture, the diffraction-limited aperture for the sensor, and the effective resolution when pixel pitch and diffraction effects are combined.
  • A focus stacking plan calculates how many shots are needed to cover a range from a near to a far distance, generating each focus distance in the sequence once the two distances and an overlap percentage are set.
  • A comparison table shows how depth of field, hyperfocal distance, and diffraction status change across standard apertures from f/1.4 to f/32 at the current focal length and distance.
  • Settings hold the output unit, decimal places, light wavelength for diffraction calculations, and the circle of confusion method: Zeiss uses a stricter divisor (sensor diagonal divided by 1730) compared to the standard method (diagonal divided by 1500).

Precision depth of field analysis serves shooting scenarios where fractions of a millimeter of sharpness matter. Macro, landscape, product, astrophotography, architecture, and medium format workflows all benefit from diffraction awareness, focus stacking, and multi-aperture comparison.

  • Macro Photography: Calculate the exact number of focus-stacked frames needed to cover a 2-inch subject at f/8 on a Micro Four Thirds sensor. The stacking planner outputs each distance step and accounts for overlap to ensure continuous sharpness across the entire subject.
  • Landscape Photography: Determine whether f/16 on a full-frame sensor introduces meaningful diffraction softening. Comparing f/11 against f/16 in the aperture table finds the sharpest aperture that still delivers front-to-back sharpness from a foreground rock at 4 feet to mountains at infinity.
  • Product Photography: Evaluate the trade-off between stopping down for greater depth of field and losing resolution to diffraction when shooting small items on a 1-inch sensor at close range. The effective resolution output shows how many useful megapixels remain at each aperture.
  • Astrophotography: Diffraction analysis confirms that a wide-open aperture of f/2.8 on a full-frame sensor sits well below the diffraction limit, ensuring maximum star point resolution. The hyperfocal distance places focus correctly for pinpoint stars.
  • Architecture and Real Estate: Plan multi-shot focus stacks for interior scenes where a tilt-shift lens is not available. Entering the near wall at 3 feet and the far wall at 30 feet finds the optimal number of focus points at f/8 with a 24mm lens.
  • Optical Engineering and Education: Step-by-step formulas make the relationship between focal length, aperture, sensor size, and diffraction explicit. Comparing Zeiss and standard circle of confusion methods shows how different sharpness criteria affect calculated depth of field.
  • Medium Format Shooters: The Fuji GFX or 6x4.5 sensor preset accounts for the larger circle of confusion and different diffraction characteristics of medium format systems, showing whether f/22 remains usable or diffraction dominates on a 50-megapixel sensor.
Inputs, outputs, and what the Advanced Depth of Field (DoF) Calculator computes

What the Advanced Depth of Field (DoF) Calculator asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

Inputs

  • Camera Sensor / Film Format · default: Full Frame (35mm)
  • Sensor Width (mm) (text input) · default: 36
  • Sensor Height (mm) (text input) · default: 24
  • Megapixels (text input) · default: 24
  • Circle of Confusion (mm) (text input) · default: 0.029
  • Focal Length (mm) (text input) · default: 50
  • Aperture (f-stop) (text input) · default: 2.8
  • Subject Distance (text input) · default: 10
  • Distance unit · default: feet
  • Output Distance Unit · default: feet
  • Decimal Places (numeric input) · default: 2 · range: 0 to 6
  • Show step-by-step formulas · default: off
  • Light Wavelength (nm) (text input) · default: 550
  • Circle of Confusion Method · default: Auto (diagonal / 1500)
  • Near Target Distance (text input)
  • Near target distance unit · default: feet
  • Far Target Distance (text input)
  • Far target distance unit · default: feet
  • Overlap (%) (text input) · default: 20
  • Show comparison table for current settings across apertures · default: off

Controls

Calculate · Reset · Calculate Stack