Depth of Field Calculator
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free depth of field calculator. Find the near and far limits of sharp focus and the hyperfocal distance from focal length, aperture and distance.
- Near limit
- 0
- Far limit
- 0
- Hyperfocal distance
- 0
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the depth of field calculator
- Enter the focal length of the lens in millimetres, the actual focal length, not a "full-frame equivalent".
- Enter the aperture, the f-number, such as 1.8, 4 or 8.
- Enter the focus distance in metres: how far away the point you've focused on is.
- Choose your sensor size, which sets the circle of confusion: 0.030 mm for full frame, 0.020 mm for APS-C, or 0.015 mm for Micro Four Thirds.
The depth of field calculator shows the near limit and far limit of acceptable sharpness, the total depth of field, and the hyperfocal distance.
What is depth of field?
A lens focuses perfectly at only one distance. But objects a little closer or farther away can still look acceptably sharp, because their blur is too small to notice. Depth of field is the range of distances, in front of and behind the focus point, that appears acceptably sharp. A shallow depth of field isolates a subject against a blurred background, popular for portraits; a deep depth of field keeps everything from foreground to horizon sharp, popular for landscapes.
How the depth of field calculator works
The calculation starts with the hyperfocal distance, H:
H = f² ÷ (N × c) + f
where f is the focal length, N the f-number and c the circle of confusion, all in millimetres. Then, for a focus distance s:
Near limit = s × (H − f) ÷ (H + s − 2f)
Far limit = s × (H − f) ÷ (H − s), or infinity if s is at or beyond H.
With the default figures, a 50 mm lens at f/8, focused at 5 metres on a full-frame camera (c = 0.03 mm), has a hyperfocal distance of 50² ÷ (8 × 0.03) + 50 ≈ 10,467 mm, about 10.47 metres. The near limit is about 3.39 metres and the far limit about 9.53 metres, so the depth of field is about 6.14 metres.
What controls depth of field?
- Aperture: a smaller aperture (a larger f-number, such as f/16) gives more depth of field; a wider aperture (a smaller f-number, such as f/1.8) gives less.
- Focus distance: depth of field increases quickly as you focus farther away, and becomes very shallow at close distances.
- Focal length: at the same focus distance and aperture, a longer lens gives less depth of field.
- Sensor size and circle of confusion: for the same framing, smaller sensors generally give more depth of field.
A worked example: a portrait
You photograph a portrait with an 85 mm lens at f/1.8, focused on the subject's eyes 2 metres away, on a full-frame camera.
- Hyperfocal distance: 85² ÷ (1.8 × 0.03) + 85 ≈ 133.9 metres.
- Near limit: about 1.972 metres.
- Far limit: about 2.029 metres.
- Depth of field: about 5.7 centimetres.
Enter 85, 1.8 and 2 in the depth of field calculator to check. With just a few centimetres in focus, the eyes can be sharp while the ears and background soften, which is why accurate focus on the eyes matters so much for portraits.
Hyperfocal distance for landscapes
When you focus at the hyperfocal distance, everything from half that distance to infinity appears acceptably sharp. Landscape photographers use this to maximise depth of field. For a 24 mm lens at f/11 on full frame, the hyperfocal distance is about 1.77 metres, so focusing there keeps everything from about 0.89 metres to infinity acceptably sharp. Focusing farther, say at 3 metres, keeps infinity sharp but moves the near limit back to about 1.11 metres. Enter 24, 11 and 3 in the depth of field calculator to see it.
The circle of confusion
The circle of confusion is the largest blur spot that still looks like a point when a photo is viewed at a typical size and distance. It depends on the sensor size, because smaller sensors' images are enlarged more for viewing. The values the depth of field calculator uses are common conventions: about 0.03 mm for full frame, 0.02 mm for APS-C, and 0.015 mm for Micro Four Thirds. If you'll make large prints, view images at 100% on screen, or crop heavily, a smaller circle of confusion, and therefore a stricter depth of field, may suit you better.
Sensor size compared
With the same lens settings, a smaller circle of confusion gives a shallower calculated depth of field. For a 50 mm lens at f/8 focused at 5 metres, the APS-C setting gives a range of about 3.80 to 7.32 metres, about 3.52 metres, compared with about 6.14 metres for full frame. In practice, photographers on smaller sensors often use shorter lenses to get the same framing, which increases depth of field again; that's why, for the same framing and f-number, smaller sensors generally show more depth of field.
Diffraction
Stopping down to a very small aperture, such as f/22, increases depth of field but also increases diffraction, a softening of the whole image caused by light spreading as it passes through a small opening. Many lenses are sharpest a few stops down from their widest aperture. Landscape photographers often balance depth of field and diffraction, using the hyperfocal distance at a moderate aperture rather than the smallest one, or combining several shots focused at different distances, a technique called focus stacking.
Who uses a depth of field calculator
Photographers use it to plan portraits, landscapes and macro shots. Videographers and cinematographers use it to plan focus pulls. Product photographers use it to keep whole products sharp. Photography students use it to understand how aperture, focal length and distance interact, and astrophotographers and landscape shooters use the hyperfocal distance for night scenes.
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit is a Google Ads agency that does PPC and nothing else: we build the campaigns, block the searches that waste money, write the ads, set up conversion tracking and send you a short report every week. Request a free PPC audit and we will show you, in dollars, what we would fix first.
Common mistakes
- Entering an equivalent focal length instead of the lens's actual focal length.
- Measuring focus distance from the lens front rather than the sensor, which matters at close range.
- Stopping down too far, where diffraction softens the image.
- Forgetting that depth of field is subjective, depending on print size and viewing distance.
Macro photography
At very close distances, depth of field becomes extremely shallow, often just millimetres, even at small apertures. The standard depth of field formulas become less accurate at macro distances, where magnification is high, and specialised macro formulas based on magnification are more reliable. Macro photographers often use small apertures, flash to provide enough light, and focus stacking, combining several images focused at slightly different distances, to get a whole insect or flower sharp. The depth of field calculator is a good guide at normal distances, but treat its results as approximate at close range.
Focus and recompose
A common technique is to focus on a subject in the centre of the frame, then move the camera to recompose the shot. At wide apertures and close distances, the change in angle can move the plane of focus enough to put the subject outside the shallow depth of field. With an 85 mm lens at f/1.8 at 2 metres, the depth of field calculator shows only about 6 centimetres in focus, so even a small shift matters. Moving the autofocus point to the subject, rather than recomposing, avoids the problem.
Group photos
For a group photo with several rows of people, you need enough depth of field to cover the distance from the front row to the back. Measure or estimate the distance to the front and back rows, then use the depth of field calculator to find an aperture and focus distance that covers both. Focusing about a third of the way into the group, rather than on the front row, often uses the available depth of field best, because at typical distances more of it lies behind the focus point than in front.
Video and focus pulling
In video, the subject or camera often moves, so the focus distance changes during a shot. Camera operators and focus pullers use depth of field calculations to know how much margin they have. A shallow depth of field looks cinematic but makes focus harder to keep, while stopping down gives more room for error. The depth of field calculator helps choose settings before a shot.
Bokeh
The out-of-focus areas of an image, and their quality, are often called bokeh. Wide apertures and long focal lengths produce smoother, more blurred backgrounds. The depth of field calculator shows where sharpness ends, but the look of the blur also depends on the lens's design, and on how far the background is beyond the far limit.
Sources and further reading
- Depth of field on Wikipedia: the factors and formulas for depth of field.
- Hyperfocal distance on Wikipedia: focusing for maximum depth of field.
- Circle of confusion on Wikipedia: the blur limit used in depth of field calculations.
Frequently asked questions
How do I calculate depth of field?
Find the hyperfocal distance, H = f² ÷ (N × c) + f, then use it to find the near and far limits.
What is the hyperfocal distance?
The focus distance that makes everything from half that distance to infinity acceptably sharp.
How do I get a shallow depth of field?
Use a wider aperture, a longer lens and a closer focus distance.
What circle of confusion should I use?
Common values are 0.03 mm for full frame, 0.02 mm for APS-C and 0.015 mm for Micro Four Thirds.
Why does the far limit show infinity?
Because you're focused at or beyond the hyperfocal distance.
Is the depth of field calculator free?
Yes. It's free, needs no sign-up, and works in your browser.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.