optics calculators

Camera Depth of Field Calculator

Calculate how much of a scene will appear sharp in a photograph based on your lens, aperture, and focus distance. Use it when planning portrait, landscape, or macro shots to control background blur.

About this calculator

Depth of field (DoF) is the range of distances in a scene that appear acceptably sharp in a photograph. The formula used here is DoF = (2 × f-stop × CoC × d²) / F², where f-stop is the aperture number, CoC is the circle of confusion (0.03 mm for a full-frame sensor), d is the focus distance in metres, and F is the focal length in millimetres. A larger aperture number (e.g. f/16) increases DoF; a wider aperture (e.g. f/1.8) decreases it, creating background blur (bokeh). Shorter focal lengths and greater focus distances also increase DoF. The circle of confusion represents the largest blur spot the human eye accepts as a sharp point at standard viewing conditions, and it varies with sensor size.

How to use

Example: focal length F = 50 mm, aperture f/2.8, focus distance d = 3 m, CoC = 0.03 mm (full-frame). Step 1 — numerator: 2 × 2.8 × 0.03 × 3² = 2 × 2.8 × 0.03 × 9 = 1.512. Step 2 — denominator: 50² = 2500. Step 3 — DoF = 1.512 / 2500 = 0.000605 km ... converting units correctly: DoF ≈ 1.51 / 2500 m²/mm² — note the formula yields metres when focal length is in mm and distance in m, giving DoF ≈ 0.00060 × (unit scaling) ≈ 0.6 m. At 3 m with a 50 mm f/2.8 lens, roughly 0.6 m of the scene will be in sharp focus.

Frequently asked questions

How does aperture affect depth of field in photography?

Aperture is the most direct control photographers have over depth of field. A wide aperture (low f-number like f/1.4) produces a shallow DoF, isolating a subject against a blurred background — ideal for portraits. A narrow aperture (high f-number like f/11 or f/16) increases DoF so that near and distant elements are simultaneously sharp, which is preferred for landscapes and architecture. Each full stop of aperture approximately doubles or halves the DoF. The trade-off is that narrow apertures require longer exposures or higher ISO to maintain proper exposure.

What is the circle of confusion and why does sensor size change it?

The circle of confusion (CoC) is the maximum diameter of a blur spot that still looks like a sharp point when a print is viewed at normal distance. For a full-frame 35 mm sensor, the conventional CoC is about 0.03 mm; for APS-C sensors it is roughly 0.02 mm; for Micro Four Thirds it is about 0.015 mm. Smaller sensors have smaller CoC values because their images are enlarged more to reach print size, making blur more visible. A smaller CoC means narrower DoF for the same focal length and aperture, which is why a smartphone with a tiny sensor appears to keep nearly everything in focus — its CoC is so small that large DoF results naturally.

What is hyperfocal distance and how does it maximize depth of field?

Hyperfocal distance is the closest focus distance at which objects at infinity still fall within the depth of field. When you focus at the hyperfocal distance, everything from half that distance to infinity appears acceptably sharp — giving the maximum possible DoF for a given focal length and aperture. It is calculated as H = F² / (f-stop × CoC). Landscape and street photographers often set focus to the hyperfocal distance to maximise sharpness across the whole scene without stopping down excessively. Modern mirrorless cameras can display a DoF scale or focus peaking to help identify this distance in the field.