Depth of Field Calculator — DoF & Hyperfocal Distance

Near Focus Limit

Far Focus Limit

Total Depth of Field

Hyperfocal Distance

In Front of Subject

Behind Subject

How Depth of Field Works

Depth of field (DoF) is the zone of acceptable sharpness in front of and behind the point on which a camera lens is focused. Any scene element within this zone appears sharp to the viewer, while elements outside it appear progressively blurred. According to B&H Photo, depth of field is controlled by three primary factors: aperture (f-stop), focal length, and the distance between the camera and the subject. A fourth factor, sensor size, influences DoF indirectly because it determines the circle of confusion threshold used in calculations.

A wider aperture (smaller f-number like f/1.4 or f/2) produces a shallower depth of field, isolating the subject from a blurred background — a technique portrait and wedding photographers rely on heavily. A narrower aperture (larger f-number like f/11 or f/16) produces a deeper depth of field, keeping more of the scene in focus — essential for landscape and architectural photography. According to Cambridge in Colour, approximately one-third of the total DoF falls in front of the focus point and two-thirds falls behind it, though this ratio shifts toward 50/50 at very close focusing distances.

Understanding DoF is fundamental to creative photography because it determines what the viewer's eye is drawn to. With over 1.8 trillion photos taken worldwide each year (according to Photutorial's 2024 statistics), mastering depth of field is one of the key techniques that separates intentional compositions from snapshots. This calculator helps you plan your shots by computing the exact near and far focus limits, total DoF, and hyperfocal distance for any combination of camera settings.

The Depth of Field Formula

Depth of field calculations begin with the hyperfocal distance: H = f^2 / (N x c) + f, where f is the lens focal length in mm, N is the f-number (aperture), and c is the circle of confusion in mm. From the hyperfocal distance, the near and far focus limits are derived. The near limit Dn = s(H - f) / (H + s - 2f) and the far limit Df = s(H - f) / (H - s), where s is the subject distance in mm. When s is greater than or equal to (H - f), the far limit extends to infinity.

Worked example: Using a full-frame camera (CoC = 0.029mm) with a 50mm lens at f/2.8, focused at 3 meters (3000mm). H = 50^2 / (2.8 x 0.029) + 50 = 2500 / 0.0812 + 50 = 30,838mm (about 30.8m). Near limit = 3000 x (30,838 - 50) / (30,838 + 3000 - 100) = 3000 x 30,788 / 33,738 = 2,738mm (2.74m). Far limit = 3000 x 30,788 / (30,838 - 3000) = 3000 x 30,788 / 27,838 = 3,318mm (3.32m). Total DoF = 3.32 - 2.74 = 0.58 meters, or about 58 centimeters of sharpness.

Key Terms You Should Know

Depth of Field by Common Camera Setups

The following table shows the total depth of field for common photography scenarios using a full-frame sensor (CoC = 0.029mm). These values demonstrate how dramatically DoF changes with different settings and subject distances. Use this as a quick reference when planning your shots.

ScenarioFocal LengthApertureSubject Dist.Total DoF
Portrait (headshot)85mmf/1.81.5m~3.4 cm
Portrait (half body)85mmf/2.83m~13 cm
Group photo35mmf/5.65m~5.6 m
Landscape (wide)24mmf/11Hyperfocal~2.7m to infinity
Macro (flower)100mmf/80.3m~0.7 mm
Street photography35mmf/83m~3.8 m
Sports (telephoto)200mmf/2.815m~43 cm

Practical Examples

Example 1 — Portrait with Blurred Background: You are shooting a headshot with an 85mm f/1.8 lens on a full-frame camera at 1.5 meters. The DoF is approximately 3.4 cm — barely enough to keep both eyes sharp if the subject is slightly angled. Stopping down to f/2.8 increases DoF to about 5.3 cm, giving more margin for error while still producing beautiful bokeh. Use our Aspect Ratio Calculator to determine the best crop for your portrait output.

Example 2 — Landscape at Hyperfocal Distance: With a 24mm lens at f/11 on a full-frame camera, the hyperfocal distance is approximately 2.7 meters. By focusing at 2.7m, everything from 1.35m (half the hyperfocal distance) to infinity will be acceptably sharp. This technique eliminates the common beginner mistake of focusing at infinity and losing foreground sharpness.

Example 3 — APS-C vs Full Frame Comparison: A 50mm lens at f/4 focused at 5 meters produces a DoF of about 2.1 meters on full-frame (CoC 0.029mm) but approximately 3.3 meters on APS-C (CoC 0.019mm). However, to get the same framing on APS-C, you would need to use a ~33mm lens (50/1.5 crop factor), which at f/4 and 5m would give an even deeper DoF of about 5.3 meters. This is why larger sensors are preferred for shallow DoF work.

Tips and Strategies for Controlling Depth of Field

This calculator is for informational purposes only. Actual depth of field may vary based on lens design, focus accuracy, and viewing conditions.

Frequently Asked Questions

What is depth of field in photography?

Depth of field (DoF) is the distance range in a photograph within which objects appear acceptably sharp. It is controlled by three main variables: aperture, focal length, and subject distance. A wide aperture like f/1.8 creates a shallow DoF that blurs the background, which is ideal for isolating portrait subjects. A narrow aperture like f/16 creates a deep DoF that keeps the entire scene sharp from foreground to background, which is preferred for landscape photography. Sensor size also affects DoF indirectly because larger sensors require longer focal lengths or closer distances for equivalent framing.

What is hyperfocal distance and when should I use it?

Hyperfocal distance is the specific focus distance that produces the maximum possible depth of field for a given lens and aperture combination. When you focus at the hyperfocal distance, everything from half that distance to infinity will appear acceptably sharp. It is calculated using the formula H = f squared divided by (N times c), where f is focal length, N is the f-number, and c is the circle of confusion for your sensor size. Landscape photographers use hyperfocal focusing as their primary technique to ensure both nearby foreground elements and distant mountains are sharp in the same frame.

How does sensor size affect depth of field?

Larger sensors produce shallower depth of field at equivalent framing because achieving the same field of view requires either a longer focal length or a closer subject distance, both of which reduce DoF. A full-frame sensor has noticeably shallower DoF than an APS-C sensor when both are framing the same subject at the same aperture. This is why smartphone cameras with tiny sensors keep nearly everything in focus, while medium format cameras produce extremely shallow DoF even at moderate apertures. The crop factor of 1.5x for APS-C means you would multiply the full-frame equivalent focal length by 1.5 to get comparable framing.

What is circle of confusion and why does it matter?

Circle of confusion (CoC) is the largest blur spot diameter on the sensor that still appears as a sharp point when the final image is viewed at standard size and distance. It is the threshold that defines the boundary of acceptable sharpness in DoF calculations. Standard CoC values are 0.029mm for full-frame 35mm sensors, 0.019mm for APS-C sensors, and 0.015mm for Micro Four Thirds sensors. Using a smaller CoC value produces stricter sharpness criteria and calculates a shallower DoF. If you plan to make very large prints or crop heavily, you may want to use a tighter CoC than the standard value.

What is the best aperture for sharp landscape photos?

Most landscape photographers use apertures between f/8 and f/11 for the best balance of depth of field and overall sharpness. While smaller apertures like f/16 or f/22 provide deeper DoF, they introduce diffraction that softens the entire image. On a full-frame camera, diffraction becomes noticeable around f/13-f/16, and on APS-C cameras around f/8-f/11. The optimal strategy is to use f/8 or f/11 combined with hyperfocal focusing to maximize the sharp zone without diffraction degradation. For scenes requiring extreme front-to-back sharpness, consider focus stacking at f/8 rather than stopping down to f/22.

How do I calculate DoF for video and cinema lenses?

Depth of field calculations for video use the same formulas as still photography, but cinema lenses express aperture as T-stops rather than f-stops. T-stops account for light transmission loss, so a T2.0 lens transmits the same light as an f/2.0 but may have slightly different DoF than an f/2.0 because the physical aperture opening can differ. For practical DoF calculations, use the T-stop value as the f-number in the formula. Super 35mm cinema sensors have a CoC of approximately 0.019mm, similar to APS-C. Use our Aspect Ratio Calculator to determine the correct sensor crop for common cinema aspect ratios like 2.39:1 or 1.85:1.

Related Calculators