Depth of Field Calculator
Calculate depth of field, hyperfocal distance, and near/far limits for any camera lens combination.
Depth of Field Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: H = fยฒ/(NรCoC) + f | DoF = Far - Near
Worked example โ DoF = 9cm | Near: 2.46m | Far: 2.54m | Very shallow โ perfect for isolating the subject
Formula
H = fยฒ/(NรCoC) + f | DoF = Far - Near
Hyperfocal distance H equals the focal length squared divided by the product of f-number and circle of confusion, plus the focal length. Near and far limits are calculated from H and subject distance. Depth of field is the range between the near and far sharp limits.
Worked Examples
Example 1: Portrait Photography Setup
Problem:Calculate DoF for an 85mm lens at f/1.8, focused at 2.5 meters on a full-frame camera.
Solution:f = 85mm, N = 1.8, d = 2500mm, CoC = 0.029mm H = (85ยฒ)/(1.8 ร 0.029) + 85 = 138,410 + 85 = 138,495mm โ 138.5m Near = 2500 ร (138495-85)/(138495+2500-170) = 2457mm โ 2.46m Far = 2500 ร (138495-85)/(138495-2500) = 2544mm โ 2.54m DoF = 2544 - 2457 = 87mm โ 9cm
Result:DoF = 9cm | Near: 2.46m | Far: 2.54m | Very shallow โ perfect for isolating the subject
Example 2: Landscape Hyperfocal Technique
Problem:Find the hyperfocal distance for a 24mm lens at f/11 on full-frame, then calculate the DoF when focused there.
Solution:f = 24mm, N = 11, CoC = 0.029mm H = (24ยฒ)/(11 ร 0.029) + 24 = 1829mm โ 1.83m Focusing at H = 1.83m: Near = 1829 ร (1829-24)/(1829+1829-48) = 915mm โ 0.91m Far = infinity (distance = H) DoF = infinity
Result:Hyperfocal = 1.83m | Near limit: 0.91m | Far limit: infinity โ everything sharp from ~1m to horizon
Frequently Asked Questions
What is depth of field in photography?
Depth of field (DoF) is the distance range in a photograph where objects appear acceptably sharp. It extends from a near limit in front of the focus point to a far limit behind it. A shallow depth of field means only a thin slice of the scene is sharp, which is popular for portraits where the background is blurred (bokeh). A deep depth of field keeps most of the scene sharp, from foreground to background, which is preferred for landscape photography. Three main factors control DoF: aperture (f-stop), focal length, and subject distance. Understanding depth of field helps photographers make creative decisions about which parts of their image are in focus.
How does aperture affect depth of field?
Aperture has the most direct and intuitive effect on depth of field. A wider aperture (smaller f-number like f/1.4 or f/2) produces a shallower depth of field, meaning less of the scene is in focus. A narrower aperture (larger f-number like f/11 or f/16) produces a deeper depth of field. This happens because a wider aperture allows light rays to enter the lens at steeper angles, causing out-of-focus areas to blur more. However, stopping down too far (beyond f/16 on most lenses) introduces diffraction, which actually reduces overall sharpness. Portrait photographers typically use f/1.4 to f/2.8, while landscape photographers often use f/8 to f/11 for the optimal balance of depth and sharpness.
What is the circle of confusion (CoC)?
The circle of confusion is the largest blur spot that still appears as a sharp point to the human eye in a print viewed at a normal distance. When a point of light is not perfectly in focus, it projects onto the sensor as a small disc rather than a point. If this disc is smaller than the CoC threshold, it appears sharp. The CoC depends on sensor size, print size, and viewing distance. Standard CoC values are 0.029mm for full-frame sensors, 0.019mm for APS-C, and 0.015mm for Micro Four Thirds. These assume an 8x10 inch print viewed at 25cm. A smaller CoC gives a stricter definition of sharpness and results in a shallower calculated depth of field.
What is hyperfocal distance and why is it useful?
The hyperfocal distance is the focus distance at which the depth of field extends from half that distance all the way to infinity. When you focus at the hyperfocal distance, you maximize the depth of field for a given aperture and focal length. This technique is extremely useful for landscape photography where you want everything from a nearby foreground to distant mountains in sharp focus. For example, with a 24mm lens at f/11 on a full-frame camera using a 0.029mm circle of confusion, the hyperfocal distance is 24 squared divided by (11 x 0.029) plus 24, which is 1830mm, about 1.83 meters. Focusing there means everything from roughly 0.91m to infinity will be acceptably sharp. Many landscape photographers memorize or carry charts of hyperfocal distances for their common lens and aperture combinations.
How does sensor size affect depth of field?
Sensor size indirectly affects depth of field in two ways. First, a smaller sensor has a smaller circle of confusion threshold, which means the standard of sharpness is stricter, resulting in a shallower calculated DoF for the same lens settings. Second, and more importantly, to get the same field of view as a larger sensor, you must use a shorter focal length, which increases DoF, or stand farther back. In practice, full-frame sensors produce shallower depth of field than APS-C or Micro Four Thirds at the same field of view and aperture. This is why smartphone cameras with tiny sensors struggle to produce background blur naturally and often use computational photography to simulate bokeh effects.
What is the difference between depth of field and bokeh?
Depth of field is a measurable distance: the span between the near and far limits of acceptable sharpness. Bokeh describes the aesthetic character of whatever falls outside that span, how smoothly a defocused highlight renders and whether it appears as a clean disc, a bright-edged ring or a polygon. Two lenses set to the same aperture and focus distance produce identical depth of field but can look very different, because bokeh depends on aberration correction and the number and curvature of the diaphragm blades.
Why is depth of field often described as one third in front and two thirds behind?
The rule of thumb holds only in a middle range of focus distances. The near and far limits are s(H minus f)/(H plus s minus 2f) and s(H minus f)/(H minus s), and those expressions are asymmetric: the far limit stretches faster than the near one as distance grows, until it reaches infinity at the hyperfocal point where the split is meaningless. At close range the distribution approaches an even split instead, which is why macro workers should not rely on the one-third rule.
How strongly does subject distance affect depth of field?
More than any other single factor at close range. For distances well short of the hyperfocal point, depth of field grows roughly with the square of the subject distance, so doubling the distance quadruples the zone of sharpness at the same aperture. Halving the distance cuts it to a quarter. At true macro magnifications the zone collapses to millimetres even at f/16, which is why product and insect photographers stack frames rather than trying to stop down their way out of it.
When should I focus stack instead of stopping down further?
Stop down while the depth of field gained still outweighs the diffraction softening that comes with a smaller aperture, which on full frame usually means somewhere around f/11 to f/16. Beyond that the whole frame loses resolution. If the near subject is still outside the zone, shoot several frames stepped through focus and blend them, keeping the lens near its sharpest aperture. Stacking needs a static subject and stable framing, so it suits macro, product and still landscape work rather than wildlife.
If I change focal length but keep the framing the same, does depth of field change?
Much less than people expect. Backing away with a longer lens to hold the subject the same size largely cancels the focal-length effect, so depth of field at the subject stays broadly similar at a given f-number. What does change is the background: the longer lens narrows the angle of view and magnifies whatever is behind the subject, so out-of-focus areas appear larger and smoother. That is a perspective and rendering difference, not a depth of field one.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎField of View Calculator (camera)
Calculate field of view (camera) with interactive inputs and clear steps.
๐งฎAudio File Size Calculator
Calculate audio file size from duration, sample rate, bit depth, and number of channels.
๐งฎCrop Factor Calculator
Calculate equivalent focal length and field of view from sensor crop factor.
๐งฎHyperfocal Distance Calculator
Calculate hyperfocal distance with interactive inputs and clear steps.
๐งฎShutter Speed to Freeze Motion Calculator
Calculate shutter speed to stop motion with interactive inputs and clear steps.
๐งฎExposure Value (ev) Calculator
Calculate exposure value (ev) with interactive inputs and clear steps.
๐งฎNeutral Density Filter Stop Calculator
Calculate neutral density filter stop with interactive inputs and clear steps.
๐งฎPanorama Overlap and Frames Calculator
Calculate panorama overlap and frames with interactive inputs and clear steps.