Depth of Field Calculator
Determine the depth of field, hyperfocal distance, and near/far focus limits for any lens and camera combination. Ideal for photographers choosing aperture and focus distance to keep subjects sharp.
About this calculator
Depth of field (DoF) is the range of distances in a scene that appear acceptably sharp in a photograph. It depends on four key variables: focal length (f), f-number (N), focus distance (d), and the circle of confusion (c), which is the largest blur spot still perceived as a point by the human eye. The full DoF formula is: DoF = (2 · N · c · (d/f)²) / (1 + (N · c · d) / f²). A larger aperture (smaller f-number) shrinks the DoF, while a longer focus distance or smaller focal length expands it. Photographers use these relationships to isolate subjects with creamy backgrounds (shallow DoF) or to keep entire landscapes sharp (deep DoF). The circle of confusion varies by sensor size — typically 0.029 mm for full-frame and 0.019 mm for APS-C cameras.
How to use
Suppose you shoot with a 50 mm lens at f/2.8, focused at 3000 mm (3 m), on a full-frame camera (c = 0.029 mm). Plug in: DoF = (2 × 2.8 × 0.029 × (3000/50)²) / (1 + (2.8 × 0.029 × 3000) / 50²). Numerator: 2 × 2.8 × 0.029 × 3600 = 586.08. Denominator: 1 + (243.6 / 2500) = 1 + 0.0974 = 1.0974. DoF ≈ 586.08 / 1.0974 ≈ 534 mm (about 53 cm). This means roughly 26 cm in front of and behind your focus point will appear sharp.
Frequently asked questions
What is the circle of confusion and how does it affect depth of field?
The circle of confusion (CoC) is the maximum diameter of a blur spot that the eye still perceives as a sharp point when viewing a standard print at a normal distance. A larger CoC value produces a deeper apparent depth of field because more blur is tolerated. It is primarily determined by sensor size — full-frame sensors use roughly 0.029 mm, APS-C sensors about 0.019 mm, and Micro Four Thirds about 0.015 mm. Using the wrong CoC for your sensor will give inaccurate DoF readings, so always match it to your camera's format.
How does f-number (aperture) change the depth of field in a photo?
The f-number controls how wide the lens aperture opens: a low f-number like f/1.8 opens the aperture wide, admitting more light but drastically narrowing the depth of field. A high f-number like f/16 closes the aperture, reducing light but extending the range of sharpness. Portrait photographers often shoot wide open (f/1.4–f/2.8) to blur busy backgrounds, while landscape photographers stop down to f/8–f/16 to keep foreground and horizon both sharp. The relationship is roughly linear — doubling the f-number approximately doubles the DoF.
What is hyperfocal distance and when should I use it?
The hyperfocal distance is the closest focus point at which objects from half that distance to infinity all appear acceptably sharp. Focusing at the hyperfocal distance maximises the depth of field for a given aperture and focal length combination. It is especially useful in landscape, street, and documentary photography where you want everything in the frame to be in focus without having to focus on a specific subject. You can calculate it as H = f² / (N × c), where f is focal length, N is f-number, and c is the circle of confusion.