Calculate depth of field

Estimate near and far acceptable-focus limits from lens, aperture, focus distance, and sensor format.

freeworks offlinenothing uploaded
ToolDepth of Field Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The thin-lens model derives circle of confusion, hyperfocal distance, and near/far limits from the supplied inputs. At or beyond hyperfocal focus, the far limit is treated as infinity.

  • Full frame is the initial sensor.
  • Depth of field is an acceptable-sharpness range, not a hard optical edge.

Worked example

50mm at f/2.8, 5 metres away
Full frame sensor, a typical portrait setup
Input
											Focal length mm: 50
Aperture: 2.8
Subject distance m: 5
										
Output
												Near limit m: 4.29
Far limit m: 6.00
Total depth m: 1.71
Hyperfocal distance m: 29.81
Circle of confusion mm: 0.03
Crop factor: 1
											

When to use this

Portrait photographers check blur, macro setups estimate narrow ranges, and landscapes choose focus near hyperfocal.

Edge cases

  • Focusing at or beyond hyperfocal sends the far limit to infinity.
  • Changing sensor format changes the circle-of-confusion assumption.
  • Diffraction can reduce detail at small apertures even as the calculated range grows.