Depth of field is the zone in front of and behind the point you focus on that still looks sharp in the final picture. A landscape photographer wants it deep, from the flowers at their feet to the mountains; a portrait photographer often wants it shallow, so the background melts away. This depth of field calculator gives you the exact limits before you press the shutter.
Enter the focal length of your lens, the aperture (f-number), the distance to your subject and your sensor format. The calculator returns the near limit and far limit of acceptable sharpness, the total depth of field, how much of it lies in front of and behind the subject, and the hyperfocal distance: the focus distance that pushes the far limit all the way to infinity.
It also works as a hyperfocal distance calculator. Read the hyperfocal value, focus there, and everything from half that distance to the horizon will be acceptably sharp, the classic technique for street and landscape photography.
How to use this calculator
- Enter the actual focal length printed on the lens (a 25 mm lens on Micro Four Thirds is 25, not 50).
- Enter the f-number: 8 for f/8, 2.8 for f/2.8.
- Enter the subject distance, measured from the camera, in metres, centimetres, feet or inches.
- Pick the sensor format. It sets the circle of confusion; choose custom if you use a stricter value for large prints or pixel-level viewing.
- Read the near and far limits, the total depth of field and the hyperfocal distance. When the far limit shows ∞, the subject is at or beyond the hyperfocal distance.
The formula
With focal length , f-number , circle of confusion and subject distance (all in the same unit), the hyperfocal distance is
and the limits of acceptable sharpness are
When , the far limit is infinite. The total depth of field is . Focused exactly at , the near limit is .
The circle of confusion is the largest blur spot that still looks like a point when the photo is viewed at a normal size and distance. The usual convention is about the sensor diagonal divided by 1,440, giving 0.030 mm for full frame, 0.020 mm for APS-C and 0.015 mm for Micro Four Thirds. These are the thin-lens formulas found in standard photographic optics texts; distances are measured from the lens.
Worked example
A 50 mm lens at f/8 on a full-frame camera ( mm), focused at 3 m:
- Hyperfocal distance: mm, about 10.47 m.
- Near limit: = 2.34 m.
- Far limit: = 4.19 m.
- Total depth of field: 1.85 m, of which 0.66 m in front of the subject and 1.19 m behind it.
Open the same lens to f/1.8 and the depth of field shrinks to only 38.4 cm: ideal for isolating a face. On an APS-C body ( mm) at f/8, the same framing distance gives 1.17 m.
Hyperfocal focusing. With a 24 mm wide-angle at f/8 on full frame, m. Focus at 2.42 m and everything from 1.21 m to infinity is acceptably sharp.
What changes depth of field
- Aperture: closing down (bigger f-number) increases depth of field roughly in proportion. Beyond f/11–f/16, diffraction starts to soften the whole image, so stopping down further is not free.
- Distance: depth of field grows quickly with distance; it is tiny in macro work and huge for distant scenes.
- Focal length: at the same distance, a longer lens gives less depth of field. At the same framing (moving back with a longer lens), the difference mostly disappears.
- Sensor size: a smaller sensor uses a smaller circle of confusion, but for the same framing it also uses a shorter lens, so the net result is more depth of field for small sensors at the same f-number.
Depth of field is not split evenly: at normal distances about one third lies in front of the subject and two thirds behind it, and the ratio moves towards 50/50 at close range.
Frequently asked questions
What is the hyperfocal distance?
It is the focus distance at which the far limit of depth of field reaches infinity. Focusing there gives the largest possible zone of sharpness, from half the hyperfocal distance to the horizon. It depends on focal length, aperture and circle of confusion.
Which circle of confusion should I use?
The defaults (0.030 mm for full frame, 0.020 mm for APS-C) assume a print about 25 cm wide viewed from 25 cm. For large prints, critical landscape work or pixel-level viewing on a high-resolution sensor, halve the value with the custom option: depth of field will be smaller and safer.
Should I enter the real focal length or the equivalent one?
The real one, printed on the lens. The sensor format setting takes care of the crop factor through the circle of confusion. Entering an equivalent focal length with a small-sensor circle of confusion would count the crop twice.
Why does the calculator show infinity for the far limit?
Because the subject is at or beyond the hyperfocal distance. Everything behind the subject, up to the horizon, falls inside the circle of confusion, so the far limit is infinite and the total depth of field is unlimited.
Is the depth of field really a sharp cut-off?
No. Sharpness falls off gradually on both sides of the focus plane; the limits only mark where blur becomes larger than the chosen circle of confusion. That is why the result depends on print size and viewing distance as much as on the lens.
Sources
- Sidney F. Ray, Applied Photographic Optics, 3rd ed., Focal Press, 2002
- Rudolf Kingslake, Optics in Photography, SPIE Press, 1992, chapter 5: Depth of Field
Last updated: