Depth of Field & Hyperfocal Distance Calculator

Calculate the near and far limits of sharp focus, total depth of field and hyperfocal distance for any lens, aperture, subject distance and camera sensor.

Updated · Free · Runs in your browser

Distance units
mm
m
Depth of field —
Near limit —
Far limit —
Front / behind —
Hyperfocal distance —
Circle of confusion —
    Was this calculator helpful?

    The formula

    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 ≥ H
    Depth of field = far limit − near limit
    f = focal length, N = f-number, c = circle of confusion (≈ 0.03 mm full frame, 0.02 mm APS-C, 0.015 mm Micro Four Thirds), s = subject distance

    Worked example

    1. A 50 mm lens at f/2.8 focused at 3 m on full frame (c = 0.03 mm):
    2. H = 50² ÷ (2.8 × 0.03) + 50 = 29,812 mm (29.8 m).
    3. Near limit = 2.73 m; far limit = 3.33 m; depth of field = 0.60 m, with 45% in front of the subject and 55% behind.
    4. Focusing at 29.8 m would make everything from 14.9 m to infinity acceptably sharp.

    What depth of field is

    Depth of field is the range of distances in a photo that appear acceptably sharp. Only one distance is truly in focus, but points a little nearer or further look sharp enough because their blur is too small to notice at a normal viewing size. A shallow depth of field, a few centimetres, isolates a portrait subject against a soft background; a deep depth of field keeps everything from foreground rocks to distant mountains sharp in a landscape. The calculator gives the near and far limits for your settings.

    What controls depth of field

    Three settings control depth of field: aperture, focus distance and focal length, together with the sensor size and how much the image is enlarged. Wider apertures (smaller f-numbers, such as f/1.8) give shallower depth of field, and narrower apertures (f/11, f/16) give deeper. Focusing closer reduces depth of field dramatically, which is why macro photography has very thin focus. Longer lenses at the same distance have less depth of field, although if you keep the subject the same size in the frame, focal length matters much less than you might expect.

    Hyperfocal distance

    The hyperfocal distance is the closest focus distance at which the far limit of depth of field reaches infinity. Focusing there makes everything from half the hyperfocal distance to infinity acceptably sharp, the maximum possible depth of field for that lens and aperture. Landscape and street photographers use it to keep both foreground and background sharp. A 24 mm lens at f/11 on full frame has a hyperfocal distance of about 1.75 m, so focusing there keeps everything from about 0.9 m to infinity sharp.

    Sensor size and the circle of confusion

    The circle of confusion is the largest blur spot that still looks like a point at a standard print size and viewing distance. Smaller sensors are enlarged more to produce the same print, so they use a smaller circle of confusion: about 0.03 mm for full frame, 0.02 mm for APS-C and 0.015 mm for Micro Four Thirds. For the same framing and f-number, smaller sensors give deeper depth of field, which is why phones keep nearly everything in focus and use software to simulate background blur. Our crop factor calculator converts equivalent apertures.

    Front and back split

    At normal distances, depth of field extends further behind the subject than in front of it; at moderate distances the split is often described as roughly one third in front and two thirds behind, though it varies. As you focus closer, the split approaches 50/50, and at the hyperfocal distance the far limit becomes infinite. Knowing the split helps when photographing groups: focus about a third of the way into the group, and use an aperture that covers its depth.

    Practical limits

    Depth of field calculations assume a standard print size and viewing distance, so if you crop heavily or view images at 100% on a high-resolution screen, the zone of acceptable sharpness looks smaller. Stopping down beyond about f/11–f/16 on many cameras starts to soften the whole image through diffraction, so for maximum sharpness front to back, photographers sometimes use focus stacking instead, blending several frames focused at different distances.

    For lens maths such as image distance and magnification, see the thin lens calculator. Planning shoots around light is easier with the sunrise and golden hour calculator, and the time-lapse calculator sets intervals for long sequences. For print sizes, use the DPI calculator.

    Frequently asked questions

    What is the hyperfocal distance?
    The focus distance that makes the depth of field extend to infinity. Focusing there makes everything from half that distance to infinity acceptably sharp.
    Does a wider aperture reduce depth of field?
    Yes. Smaller f-numbers such as f/1.8 give shallower depth of field than larger ones such as f/11.
    Why do phone photos have so much depth of field?
    Phone sensors and lenses are tiny, so for the same framing they produce much deeper depth of field. Portrait modes simulate blur with software.
    What circle of confusion should I use?
    About 0.03 mm for full frame, 0.02 mm for APS-C and 0.015 mm for Micro Four Thirds are common standards. Use smaller values for large prints or critical viewing.
    How do I get the whole landscape sharp?
    Use a moderate aperture such as f/8–f/11 and focus at the hyperfocal distance, or focus-stack several frames for maximum sharpness.

    ↑↓ to navigate · Enter to open