Depth of Field (DOF) Calculator

Calculate near and far depth-of-field limits and the hyperfocal distance from focal length, aperture, focus distance, and sensor size.

Inputs

Lens focal length in millimetres.

The f-stop, e.g. 8 for f/8.

Distance from the camera to the subject, in metres.

Sensor format sets the circle of confusion (CoC) used for "acceptably sharp".

Result

Total depth of field
1.766 m
near 2.358 m → 4.124 m
  • Hyperfocal distance10.826 m
  • Near limit2.358 m
  • Far limit4.124 m
  • Total DOF1.766 m
  • In front of subject0.642 m
  • Behind subject1.124 m
  • Circle of confusion0.029 mm
Note — DOF is a perceptual range of "acceptable" sharpness, set by the circle of confusion for the format and typical viewing. Diffraction at very small apertures and focus-breathing are not modelled.

Step-by-step

  1. Hyperfocal H = f²/(N·c) + f = 50²/(8×0.029) + 50 = 10.826 m.
  2. Near limit = H·s/(H + (s−f)) = 2.358 m.
  3. Far limit = H·s/(H − (s−f)) = 4.124 m; total DOF = 1.766 m.

How to use this calculator

  • Enter the lens focal length in mm and the aperture f-number.
  • Enter the focus (subject) distance in metres.
  • Select your sensor format so the right circle of confusion is used.
  • Read the near and far limits, total DOF, and hyperfocal distance.

About this calculator

Depth of field (DOF) is the range of distances in a photo that appear acceptably sharp. It depends on four things: the lens focal length, the aperture, how far away you focus, and the sensor format — which sets the "circle of confusion," the largest blur spot still perceived as a point. This calculator computes the near and far limits of sharpness, the total depth of field, and the hyperfocal distance: the focus distance at which everything from half that distance to infinity is sharp. Wider apertures (smaller f-numbers), longer lenses, and closer subjects all shrink the depth of field; stopping down, using a shorter lens, or focusing farther away expands it. When your focus distance reaches or exceeds the hyperfocal distance, the far limit extends to infinity.

How it works — the formula

Hyperfocal H = f²/(N·c) + f Near limit = H·s / (H + (s − f)) Far limit = H·s / (H − (s − f)) [∞ if s ≥ H] (f, c in mm; s = focus distance)

The hyperfocal distance sets the scale of sharpness for a given focal length, aperture, and circle of confusion. Near and far limits are derived from it and the focus distance; the far limit diverges to infinity once you focus at or beyond the hyperfocal distance.

Worked examples

Example 1
50 mm, f/8, 3 m, full frame
Inputs:
focal=50, aperture=8, distance=3, sensor=ff
Output:
H≈10.8 m, near 2.36 m, far 4.12 m, DOF≈1.77 m
Example 2
24 mm, f/11, 2 m, full frame
Inputs:
focal=24, aperture=11, distance=2, sensor=ff
Output:
H≈1.83 m; 2 m ≥ H → far = ∞
Example 3
85 mm, f/1.8, 1.5 m, full frame
Inputs:
focal=85, aperture=1.8, distance=1.5, sensor=ff
Output:
DOF ≈ 0.03 m (very shallow)

Limitations

  • Circle of confusion is a convention (sensor diagonal ÷ 1500); your sharpness standard may differ.
  • Diffraction softening at small apertures is not modelled.
  • Assumes the focus distance is measured to the subject, not the sensor plane offset.

DOF is perceptual; treat the limits as guidance, not a hard sharp/blurred boundary.

Frequently asked

Depth of field is the zone, from a near limit to a far limit, in which objects look acceptably sharp in the final image. Outside that zone, detail blurs progressively. It is a perceptual range, defined relative to a circle of confusion that depends on sensor size and viewing conditions.

Related calculators

More tools you might like