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

Loading calculatorโ€ฆ
โ€”

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

What is depth of field?+
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.
What is the hyperfocal distance?+
The hyperfocal distance is the closest focus distance at which the far limit of depth of field reaches infinity. Focusing there maximises DOF: everything from half the hyperfocal distance out to infinity is acceptably sharp. It is widely used in landscape photography.
What is the circle of confusion?+
It is the largest blur spot on the sensor that still looks like a sharp point in the final print or screen view. Smaller sensors use a smaller circle of confusion (roughly the sensor diagonal รท 1500), which is why this calculator asks for your format โ€” full frame uses about 0.029 mm, APS-C about 0.019 mm.
How does aperture affect depth of field?+
A smaller aperture (larger f-number, e.g. f/16) increases depth of field; a wider aperture (smaller f-number, e.g. f/1.8) shrinks it for a blurred background. Each stop down roughly proportionally extends the hyperfocal-based limits, though diffraction softens the whole image at very small apertures.
Why is depth of field not symmetric around the subject?+
For typical distances, more of the in-focus zone falls behind the subject than in front โ€” often roughly one-third in front and two-thirds behind, though the exact split varies with distance. This calculator shows the front and rear portions separately.
Does a crop sensor change depth of field?+
Yes. For the same framing and aperture, a smaller sensor has greater depth of field because it uses a shorter actual focal length and a smaller circle of confusion. Selecting the correct format here accounts for the circle-of-confusion part of that effect.

Related calculators

More tools you might like

Hand-picked tools that pair well with this one โ€” same audience, same intent.