N
Numly
Go Pro
๐Ÿ“ธ

Depth of Field Calculator

Calculate near/far limits, DOF, and hyperfocal distance for any camera and lens.

Kai NakamuraVerified

BFA Digital Media, Certified Adobe Educator

Creative technologist specialising in photography, music production, game design and digital media across consumer and professional platforms.

mm
m
Enter values above to see your result

Related calculators

About the Depth of Field Calculator

Depth of field (DOF) is the range of distances in a scene that appear acceptably sharp in a photograph. It is not a binary sharp/unsharp boundary but a gradual transition โ€” objects closer or farther than the focus point become progressively blurrier as the circle of confusion (the disc of blur projected by an out-of-focus point) grows larger relative to the resolution of the image. The "acceptable" threshold is defined by the circle of confusion (CoC) diameter: conventionally the minimum visible print detail at typical viewing distance, approximately 0.029 mm for full-frame sensors viewed as a 25 cm print at arm's length.

Depth of field is controlled by three variables: aperture (f-number), focal length, and focus distance. Wider aperture (lower f-number, e.g. f/1.4) produces shallower DOF โ€” more background blur. Longer focal length compresses depth of field at equivalent framing. Closer focus distance dramatically reduces DOF. The interplay between these creates the characteristic aesthetic of portraiture (long lens, wide aperture, close distance = shallow DOF) versus landscape photography (shorter lens, stopped-down aperture, focused at hyperfocal distance = maximum DOF).

The hyperfocal distance is the closest focus distance at which the far limit of depth of field extends to infinity. When you focus at the hyperfocal distance, everything from half the hyperfocal distance to infinity appears acceptably sharp โ€” maximising the total sharp zone for a given aperture and focal length. Landscape photographers routinely use hyperfocal focusing to ensure foreground rocks are sharp while distant mountains are also in focus. This calculator uses the standard thin-lens approximations, which are accurate for distances much greater than the focal length (i.e., most practical photography beyond a few metres).

How it works

Hyperfocal (H) = flยฒ / (N ร— C)
Near limit = (H ร— d) / (H + d โˆ’ fl)
Far limit = (H ร— d) / (H โˆ’ d + fl)  [= โˆž when d โ‰ฅ H]
Depth of Field = Far limit โˆ’ Near limit

Where

flFocal length in mm
NAperture f-number (e.g. 2.8, 5.6, 11)
CCircle of confusion diameter in mm (sensor-dependent: 0.029 mm full frame, 0.019 mm APS-C)
dFocus distance in mm
HHyperfocal distance in mm โ€” focus here to maximise DOF to infinity

Worked example

Portrait setup: 85mm lens at f/1.8, focused at 2 m, full-frame sensor (CoC = 0.029 mm).

Hyperfocal H = 85ยฒ / (1.8 ร— 0.029) = 7,225 / 0.0522 = 138,467 mm โ‰ˆ 138.5 m.

Near limit = (138,467 ร— 2,000) / (138,467 + 2,000 โˆ’ 85) = 276,934,000 / 140,382 โ‰ˆ 1,973 mm โ‰ˆ 1.97 m.

Far limit = (138,467 ร— 2,000) / (138,467 โˆ’ 2,000 + 85) = 276,934,000 / 136,552 โ‰ˆ 2,028 mm โ‰ˆ 2.03 m.

Depth of field = 2.03 โˆ’ 1.97 = 0.06 m = 6 cm.

Only 6 cm of the scene is in focus โ€” perfect for isolating the subject's face from the background.

Tips to improve your result

  • 1.

    The rule of thirds for DOF: approximately one-third of the depth of field falls in front of the focus point and two-thirds behind it (at moderate distances). To maximise sharp foreground and background, focus slightly in front of the midpoint of the range you want sharp.

  • 2.

    Focus breathing (the change in effective focal length as you change focus distance) is significant with some lenses โ€” particularly vintage glass and cinema lenses. If precise DOF calculation matters (focus pulling, follow focus), use lens datasheets rather than thin-lens approximations for the most accurate results.

  • 3.

    On smartphones, the "portrait mode" bokeh is entirely computational โ€” the camera uses multi-camera systems, depth sensors, and AI segmentation to create artificial shallow DOF. Real lens physics still applies to the primary camera, which typically has a fixed aperture equivalent to f/1.5โ€“f/2.0 โ€” but the sensor is so small (1/1.5" to 1/1.3") that real optical DOF is very deep even at that aperture.

  • 4.

    Diffraction limits maximum sharpness at small apertures (f/11 and above on full frame, f/8 on APS-C, f/5.6 on MFT). Stopping down beyond these apertures increases DOF on paper but reduces resolution due to diffraction โ€” "diffraction-limited" apertures are where the two effects cancel and shooting beyond them only costs sharpness.

  • 5.

    Use live view magnification (5ร— or 10ร— zoom) or focus peaking when critical precision matters. Even with manual focus and a DOF scale, focusing errors are the most common cause of unexpectedly soft images โ€” particularly with shallow DOF portraiture at f/1.4โ€“f/1.8 where the sharp zone may be narrower than an eye.

Frequently asked questions

Was this helpful?
0 found helpful