optics calculators

Depth of Field Calculator

Compute the total depth of field for any camera and lens combination using focal length, f-number, focus distance, and circle of confusion. Use it to plan sharp focus zones before a shoot.

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 factors: focal length (f), f-number (N), focus distance (d), and the circle of confusion (c) — the maximum blur diameter considered acceptably sharp for the output size. The simplified total DoF formula used here is: DoF = (2 × N × c × d²) / f², where all distances are in the same units (millimetres). A larger f-number (narrower aperture), shorter focal length, or greater focus distance all increase DoF. Conversely, wide apertures and long telephoto lenses produce a shallow DoF — the effect behind portrait bokeh. The circle of confusion is typically around 0.029 mm for a full-frame sensor and 0.019 mm for APS-C.

How to use

You are shooting with a 50 mm lens at f/8, focused at 3000 mm (3 m), on a full-frame camera (c = 0.029 mm). Step 1 — Enter 50 in Focal Length. Step 2 — Enter 8 in F-Number. Step 3 — Enter 3000 in Focus Distance. Step 4 — Enter 0.029 in Circle of Confusion. Step 5 — DoF = (2 × 8 × 0.029 × 3000²) / 50² = (2 × 8 × 0.029 × 9,000,000) / 2500 = 4,176,000 / 2500 ≈ 1670 mm ≈ 1.67 m. Objects between about 2.16 m and 3.84 m from the camera will appear sharp.

Frequently asked questions

What circle of confusion value should I use for my camera sensor?

The circle of confusion (CoC) depends on your sensor size and the final output size and viewing distance, but standard values are widely used: approximately 0.029 mm for full-frame (35 mm) sensors, 0.019 mm for APS-C sensors (Canon crop), 0.020 mm for Nikon DX, and 0.015 mm for Micro Four Thirds. These values assume an 8×10 inch print viewed at 25 cm. If you plan to print very large or crop heavily, use a smaller CoC to maintain apparent sharpness. Many online references and camera manufacturers publish recommended CoC values for each sensor format.

How does aperture (f-number) affect depth of field in practice?

Depth of field is directly proportional to the f-number: doubling the f-number (e.g., going from f/2.8 to f/5.6) doubles the DoF, all else being equal. Wide apertures like f/1.4 or f/1.8 produce very shallow DoF — sometimes just centimetres at close focus distances — creating the blurred backgrounds popular in portrait and macro photography. Narrow apertures like f/11 or f/16 extend DoF dramatically and are favoured in landscape photography where sharpness from foreground to horizon is desired. However, stopping down beyond about f/11 on most sensors introduces diffraction softening, so there is a practical limit to how much sharpening comes from a smaller aperture.

Why does focal length affect depth of field and how significant is the difference?

Because DoF = (2 × N × c × d²) / f², focal length appears squared in the denominator — a doubled focal length reduces DoF by a factor of four, assuming the same subject framing, aperture, and camera. This is why a 200 mm telephoto lens at f/4 produces a much shallower DoF than a 24 mm wide-angle at f/4 focused at the same subject size. However, if you physically move closer with the wide-angle to fill the frame with the same subject, the shorter focus distance partially compensates and the DoF difference narrows. The relationship between focal length, subject distance, and DoF is therefore nuanced, which is why a calculator is more reliable than rules of thumb.