Advanced Depth of Field (DoF) Calculatorv1.0.0
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.
Documentation
Calculate depth of field with diffraction awareness by combining sensor specifications, focal length, aperture, and subject distance into a single analysis. Review hyperfocal distance, Airy disk diameter, effective megapixels, and front-to-back distribution in one view, then plan focus stacking sequences or compare apertures across the full range of any lens.
- Select the Camera Sensor / Film Format from the dropdown. Each preset includes sensor dimensions and a typical megapixel count used to compute pixel-level sharpness. Choose Custom to enter your own sensor width, height, megapixels, and optional circle of confusion value.
- Enter the Focal Length in millimeters. Fractions, mixed numbers, decimals, and scientific notation are all accepted.
- Enter the Aperture as an f-stop number. The diffraction analysis section will warn you if the selected aperture exceeds the diffraction-limited aperture for the sensor.
- Enter the Subject Distance and select the unit. Results update automatically as you type with a 500-millisecond debounce, or click Calculate to trigger computation manually.
- Review the Results section for standard DoF metrics: near limit, far limit, total depth of field, hyperfocal distance, magnification, horizontal field of view, and front-to-back distribution.
- Check the Diffraction Analysis section for the Airy disk diameter at the current aperture, the diffraction-limited aperture for the sensor, and the effective resolution when combining pixel pitch and diffraction effects.
- Use the Focus Stacking Plan to calculate how many shots are needed to cover a range from a near to far distance. Enter both distances, set the overlap percentage, and click Calculate Stack to generate each focus distance in the sequence.
- Enable Show comparison table to see how depth of field, hyperfocal distance, and diffraction status change across standard apertures from f/1.4 to f/32 for the current focal length and distance.
- Open Settings to change the output unit, decimal places, light wavelength for diffraction calculations, or circle of confusion method. Zeiss uses a stricter divisor (diagonal / 1730) compared to the standard (diagonal / 1500).
- Click Reset to restore all inputs to factory defaults and clear saved state from localStorage.
Apply precision depth of field analysis to demanding 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. Compare f/11 against f/16 in the aperture table to find 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: Use diffraction analysis to confirm 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. Verify the hyperfocal distance to place 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. Enter the near wall at 3 feet and the far wall at 30 feet to find the optimal number of focus points at f/8 with a 24mm lens.
- Optical Engineering and Education: Enable step-by-step formulas to study the relationship between focal length, aperture, sensor size, and diffraction. Compare Zeiss and standard circle of confusion methods to understand how different sharpness criteria affect calculated depth of field.
- Medium Format Shooters: Select the Fuji GFX or 6x4.5 sensor preset to account for the larger circle of confusion and different diffraction characteristics of medium format systems. Determine whether f/22 remains usable or if diffraction dominates on a 50-megapixel sensor.
Inputs, outputs, and what the Advanced Depth of Field (DoF) Calculator computes
The form above accepts the following inputs and produces the outputs listed below. This summary is rendered in the page so the parameters are visible to crawlers, assistive tech, and indexing agents that don't fetch the embedded tool frame.
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
- 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
Controls
Calculate · Reset · Calculate Stack
Worked example
The diffraction analysis section will warn you if the selected aperture exceeds the diffraction-limited aperture for the sensor.