← All tools

Depth of field & f/#

Find how much of the scene stays in focus for a given lens, aperture and focus distance, and check whether diffraction is starting to limit sharpness as you stop down.

mm
f/#

mm
µm

For a camera sensor, about 2 pixels is a common choice (6.9 µm for 3.45 µm pixels). For full-frame photography, 30 µm is traditional.

nm
Hyperfocal distance

In acceptable focusFocus planeHyperfocal distance

How this works

Hyperfocal distanceH = f² / (N · c) + f
H / f ≈ f / (N · c)

With the lens focused at infinity, everything beyond H is acceptably sharp. Focus at H instead and the sharp zone runs from H/2 all the way to infinity, the most depth you can get. As a multiple of the focal length it is about f / (N·c), so it grows with longer lenses and shrinks as you stop down.

Near and far limitsnear = s (H − f) / (H + s − 2f)
far = s (H − f) / (H − s)

s is the focus distance. When s ≥ H, the far limit is infinity.

Working f-numberNw = N · (1 + m), m = f / (s − f)

Up close the cone of light reaching the sensor gets narrower than the marked f-number suggests. This matters for diffraction and exposure.

Diffraction blurAiry diameter = 2.44 · λ · Nw

Once the Airy disk is larger than your circle of confusion, stopping down further adds depth of field but no longer gives a sharper image.

  • Uses a thin lens model with distances measured from the lens. Real lenses differ slightly, mostly at close focus, and pupil magnification is assumed to be 1.
  • Depth of field is a judgment, not a hard edge: blur grows gradually away from the focus plane, and the circle of confusion sets where you call it "sharp enough".
  • Depth of field and diffraction trade off. Choose the f-number where the depth you need is reached before diffraction blur outgrows the circle of confusion.