SoupCalc

Depth of Field and Hyperfocal Distance Calculator

Depth of Field and Hyperfocal Distance

This calculator estimates the range of object distances that meet a chosen acceptable sharpness criterion in a simplified thin-lens model. It uses focal length, aperture f-number, focus distance, and a circle-of-confusion diameter. The result is a planning estimate, not a measurement of a particular lens, sensor, print, or viewer.

Selecting a sensor format supplies a conventional circle-of-confusion value. Choosing “custom” uses the value entered in millimetres. Sensor format affects the calculation only through that criterion; it does not independently change the optics.

Method and formula

All internal distances are first expressed in millimetres. With focal length f, f-number N, circle of confusion c, and focus distance s, hyperfocal distance is:

H = f² ÷ (N × c) + f

The near acceptable-focus limit is:

Dnear = H × s ÷ (H + s − f)

When H − s + f is positive, the far limit is:

Dfar = H × s ÷ (H − s + f)

If that denominator is zero or negative, the displayed far limit and total depth of field are infinity. Otherwise, total depth of field is Dfar − Dnear.

Worked example

Use a 50 mm lens at f/2.8, focused at 2 m, with a 0.03 mm circle of confusion. The equations give a hyperfocal distance of 29.81 m.

The near limit is 1.88 m, the far limit is 2.14 m, and the total estimated depth of field is about 0.26 m after rounding. Objects just inside or outside these figures do not suddenly switch between perfectly sharp and unusably blurred; the boundary comes from the selected blur criterion.

What the result means

Near and far limits describe where defocus blur reaches the chosen circle-of-confusion diameter under the model. Smaller circles of confusion impose a stricter standard and usually reduce the reported range. Closing the aperture or increasing focus distance usually expands the range, subject to the model and diffraction trade-offs.

Hyperfocal distance is the focus setting at which the far limit reaches infinity for the selected f, N, and c. It is not a guarantee that every detail from half that distance to the horizon will appear equally sharp in every output.

Optical and practical limitations

  • Circle of confusion is a viewing and output assumption, not a sensor constant. Print size, viewing distance, eyesight, resolution, sharpening, and artistic standards can require a different value.
  • The thin-lens equations omit pupil magnification, focus breathing, field curvature, aberrations, diffraction, camera movement, subject movement, and manufacturer focus-scale tolerances.
  • Macro and close-focus work can require magnification-aware equations. This tool rejects a focus distance at or behind the entered focal length but is not a macro calculator.
  • Verify critical focus with the actual camera, lens, output size, and intended viewing conditions.

Sources

Editorial record

  • Author: SoupCalc Editorial Team
  • Method review: SoupCalc Optics and Engineering Review
  • Last reviewed: August 10, 2026
  • Review scope: unit consistency, thin-lens equations, infinity handling, circle-of-confusion assumptions, and example reproduction