About this calculator
Depth of field is the zone in front of and behind your focus point that still looks acceptably sharp. It depends on your focal length, aperture, subject distance, and sensor size (via the circle of confusion). This calculator uses the standard hyperfocal-distance formulas that most photography references and DoF calculator apps use. Results are estimates for typical viewing conditions — actual sharpness also depends on print size, viewing distance, and lens quality.
How the calculation works
The calculator first finds the hyperfocal distance, H = f²/(N·c) + f, where f is focal length, N is the f-number and c is the circle of confusion set by sensor size. For a subject distance s it then finds the near limit Dn = H·s/(H+(s−f)) and the far limit Df = H·s/(H−(s−f)); the difference is the total depth of field.
When the subject distance reaches the hyperfocal distance or more, the far limit is shown as infinity. Enter the distance from the camera sensor (focal plane) to the subject.
Worked examples
- On full frame (circle of confusion 0.03 mm), a 50 mm lens at f/1.8 focused at 2 m has a hyperfocal distance of about 46.3 m. The sharp zone runs from about 1.92 m to 2.09 m, a total depth of field of only about 17 cm.
- An 85 mm lens at f/1.8 on a portrait subject 3 m away gives roughly 2.94 m to 3.07 m (about 13 cm). That is why you need to place focus precisely on the eyes.
- A 24 mm lens at f/11 focused at 3 m has a hyperfocal distance of about 1.77 m, so the far limit is infinity and the near limit is about 1.12 m. Everything from 1.12 m to infinity is sharp.
- With the same 50 mm, f/8 and 2 m, full frame gives about 1.69 m to 2.46 m (about 77 cm), while Micro Four Thirds (circle of confusion 0.015 mm) gives about 1.83 m to 2.21 m (about 38 cm). Sensor size changes the result.
When to use it
For landscapes, use it to find where to focus so a nearby flower and a distant mountain are both sharp. For portraits, use it to judge how far to open the aperture for enough background blur. Before buying a lens you can also compare the depth of field of f/1.4 and f/2.8 at the same angle of view in numbers.
Limits and common mistakes
- The circle of confusion is a viewing-condition reference value. If you print large or zoom in far, the truly sharp zone can be narrower than calculated.
- Stopping down too far softens the whole image through diffraction. Closing to f/22 for more depth of field is not always a gain.
- The calculation assumes focus lands exactly where you aimed. With shallow depth of field, small autofocus errors change the result a lot.
- Choosing a sensor size that does not match your camera shifts the result. On a crop body, check the sensor size first.
- Enter the real focal length printed on the lens, not an equivalent value.
Guides that pair well with this calculator
For reference only. Real-world sharpness can vary with your specific lens and how the final image is viewed or printed.
Frequently Asked Questions
What is hyperfocal distance?+
It's the focus distance that gives you the maximum depth of field for a given focal length and aperture — everything from half that distance to infinity appears acceptably sharp.
Why does sensor size affect the result?+
Smaller sensors need a smaller circle of confusion to look equally sharp when viewed at the same size, which changes the depth of field for the same focal length and aperture.
Is this exact for my camera?+
It's a close, industry-standard approximation. For critical work, treat the results as a starting point rather than an exact guarantee.

