Depth of Field Calculator: Near and Far Limits and Hyperfocal Distance
By FindMySum · Last reviewed
No photograph is sharp everywhere. A lens focuses perfectly at one distance, and things nearer or farther blur a little more the further they are from it. Depth of field is the zone in which that blur stays too small to notice. This depth of field calculator gives the near and far limits of that zone for any lens, aperture, focus distance and sensor size, the total depth and how it splits in front of and behind your subject, the hyperfocal distance, and a table of the same shot at every full stop from f/1.4 to f/22.
The circle of confusion
A point that is slightly out of focus records as a small disc instead of a point. If the disc is small enough, the eye still sees a point. That largest acceptable disc on the sensor is the circle of confusion, c. For a full-frame (35 mm) sensor the usual value is 0.030 mm, which corresponds to a print about 20 × 25 cm viewed from arm's length.
Smaller sensors have to be enlarged more for the same print, so their circle of confusion is smaller, by the crop factor: 0.020 mm on a 1.5× APS-C camera, about 0.019 mm on Canon's 1.6× APS-C, and 0.015 mm on Micro Four Thirds. These are the DOFMaster values the calculator uses. You can enter your own if you print very large or inspect images at 100%.
The formulas
With focal length f, f-number N, circle of confusion c and focus distance s:
- hyperfocal distance H = f² ÷ (N × c) + f
- near limit = s(H − f) ÷ (H + s − 2f)
- far limit = s(H − f) ÷ (H − s), or infinity when s is at or beyond H
These come from the thin-lens equation and similar triangles. They are accurate for normal shooting distances; for close-up and macro work the lens's extension and pupil magnification matter and these formulas understate the sharp zone's thinness.
Worked example: a 50 mm lens at f/8
The calculator opens with a 50 mm lens on a full-frame camera at f/8, focused on a subject 5 m away:
- H = 50² ÷ (8 × 0.030) + 50 = 10,467 mm, or 10.47 m
- near limit = 5 × (10.47 − 0.05) ÷ (10.47 + 5 − 0.10) = 3.39 m
- far limit = 5 × (10.47 − 0.05) ÷ (10.47 − 5) = 9.53 m
- depth of field = 9.53 − 3.39 = 6.14 m: 1.61 m in front of the subject and 4.53 m behind
Open up to f/2 and the sharp zone shrinks to about 1.2 m; stop down to f/16 and it runs from about 2.6 m to about 100 m.
What controls depth of field
- Aperture: the biggest lever. Each stop smaller (a larger f-number) deepens the zone.
- Distance: depth of field grows rapidly with the focus distance. Close-ups are razor thin; distant scenes are sharp throughout.
- Focal length: at the same distance, a longer lens has much less depth of field.
- Sensor size: for the same framing and f-number, a smaller sensor gives more depth of field. Multiply the focal length and the f-number by the crop factor to find the full-frame equivalent: a 25 mm lens at f/2.8 on Micro Four Thirds frames and renders depth like a 50 mm lens at f/5.6 on full frame.
The hyperfocal distance
Focus at the hyperfocal distance and everything from half that distance to infinity is acceptably sharp: the deepest depth of field you can get at that aperture. Landscape and street photographers use it to keep both the foreground and the horizon sharp, or to pre-focus without autofocus. With an 18 mm lens at f/11 on an APS-C camera, the hyperfocal distance is only about 1.5 m, so focusing there covers everything from 0.75 m to the horizon.
In front of and behind the subject
At ordinary distances, about a third of the depth of field lies in front of the focus point and two thirds behind it, which is why it is often better to focus a little into a scene than on its nearest point. Close up, the split tends toward half and half. Near the hyperfocal distance, the part behind stretches to infinity.
Limits
Depth of field is a convention, not a hard boundary: sharpness fades gradually. Diffraction softens the whole image at very small apertures, and real lenses have aberrations the thin-lens model ignores. Use the numbers as a reliable guide, then check on the camera.
More questions
Why do my landscape photos look soft at f/22?
Diffraction. At very small apertures, light spreading around the edges of the opening blurs fine detail across the whole image, even though the depth of field is huge. On most modern sensors the sharpest results come around f/5.6 to f/11. Focusing at the hyperfocal distance at f/8 or f/11 usually gives more overall sharpness than stopping down to f/22.
Does focal length really change depth of field?
At the same framing of the subject, much less than people think: moving back with a longer lens to keep the subject the same size leaves the depth of field around the subject roughly unchanged. What changes is how blurred the distant background looks and how much of it is in the frame. At the same distance, though, a longer lens has much less depth of field.
What is bokeh?
The look of the out-of-focus parts of an image: how smooth the blur is and the shape of out-of-focus highlights. Depth of field tells you where the blur starts; bokeh describes its character, which depends on the lens design and the shape of the aperture blades.
How do I use the hyperfocal distance in practice?
Set your aperture, look up the hyperfocal distance, and focus there, either by the lens's distance scale or on something at about that distance. Everything from half that distance to the horizon will be acceptably sharp. Many landscape photographers focus a little beyond the hyperfocal distance to protect the horizon.
Is depth of field the same as depth of focus?
No. Depth of field is the range of subject distances that look sharp. Depth of focus is the tiny range of positions of the sensor behind the lens that keep a given subject sharp, which matters to lens and camera makers for manufacturing tolerances.
Does the calculator work for phones?
Yes, if you enter the real focal length (often 5 to 7 mm) and a custom circle of confusion of about 0.030 mm divided by the phone's crop factor, often 4 to 7. The tiny sensor is why phones get so much depth of field, and why portrait modes simulate background blur in software.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.