Depth of Field & Hyperfocal Distance Calculator

Near and far limits of sharpness, and the hyperfocal distance, for any lens.

Learn it on video

The physics behind it, simulated and explained on The Optical Bench on YouTube.

Subscribe to The Optical Bench

What depth of field is

A lens focuses perfectly at only one distance. In front of and behind that distance, points turn into tiny blurred discs. While those discs stay smaller than the circle of confusion, our eyes still read them as sharp. The zone where this is true is the depth of field (DOF).

The formulas this calculator uses

All lengths are in millimetres. f is the focal length, N is the f-number, c is the circle of confusion and s is the focus distance.

c = sensor diagonal / 1500
H = f² / (N·c) + f            (hyperfocal distance)
near = s(H − f) / (H + s − 2f)
far  = s(H − f) / (H − s)      (∞ when s ≥ H)

These are thin-lens formulas. They are very accurate at normal distances and less so in macro work. The circle of confusion assumes a typical print or screen viewed at a normal distance. If you look at pixels at 100%, everything gets "less sharp".

Hyperfocal distance in practice

Focus at the hyperfocal distance H and everything from H/2 to infinity is acceptably sharp. That makes it ideal for landscapes and night skies. Stopping down helps, but only up to a point. Past about f/11 on APS-C (f/16 on full frame), diffraction starts to soften the whole image.

Gear that helps

Some links on this page are affiliate links: if you buy through them we may earn a small commission, at no extra cost to you. As an Amazon Associate I earn from qualifying purchases. Products are picked from public specifications; we don't claim to have tested them.

More free tools

◐Exposure triangle simulatorDrag aperture, shutter speed and ISO and watch blur, motion and noise change.☰Camera settings for any scenePortrait, landscape, sport, night, waterfall… pick a scene and get starting settings.☀Golden hour & blue hour timesGolden hour, blue hour, sunrise and sunset for any place and date.