Depth of Field Calculator

Depth of field (DoF) is the zone of acceptable sharpness in a photograph, bounded by a near focus limit and a far focus limit. Everything within that zone appears sharp to the viewer; objects outside it appear progressively blurred. Three variables control DoF: aperture (f-stop), focal length, and subject distance. A fourth factor, sensor format, determines the circle of confusion, which sets the threshold for what counts as "acceptably sharp" at normal print and screen viewing sizes. Wide apertures such as f/1.4 or f/2 produce very shallow depth of field, ideal for isolating a portrait subject or close-up detail against a creamy blurred background. Narrow apertures such as f/11 or f/16 push depth of field deep into the scene, keeping a wide foreground-to-background range sharp. Shorter focal lengths also extend depth of field: a 24 mm wide-angle lens at f/8 covers far more depth than a 200 mm telephoto at the same aperture and distance. This calculator uses the standard optical formulas to compute near limit, far limit, total depth of field, and hyperfocal distance for four common sensor formats. Select your aperture, focal length, subject distance, and sensor, and the results update instantly.

Total depth of field: -- m

Near limit: -- m  |  Far limit: -- m  |  Hyperfocal: -- m. Formula: H = f² / (N × c); Near = u·f² / (f² + N·c·(u−f)); Far = u·f² / (f² − N·c·(u−f)).

The f-number (focal ratio) of the lens
Enter the lens focal length in millimetres
Distance from camera to subject in metres
Sensor size determines circle of confusion
Depth of field--
Near focus limit-- m
Far focus limit-- m
Hyperfocal distance-- m

How depth of field is calculated

The standard DoF formulas are derived from geometric optics and the circle of confusion (CoC) concept. All quantities are in millimetres during calculation; results are converted to metres for display.

H (hyperfocal, mm) = f² / (N × c)
Near limit (mm) = u × f² / (f² + N × c × (u − f))
Far limit (mm) = u × f² / (f² − N × c × (u − f))
If denominator ≤ 0, Far limit = Infinity
DoF = Far − Near (in metres)

where: f = focal length (mm), N = f-number, c = circle of confusion (mm), u = subject distance (mm)

Worked example

50 mm lens, f/5.6, subject at 3 m (3,000 mm), full-frame sensor (c = 0.029 mm):

  1. H = 50² / (5.6 × 0.029) = 2,500 / 0.1624 = 15,393 mm (15.39 m)
  2. Near = 3,000 × 2,500 / (2,500 + 5.6 × 0.029 × (3,000 − 50)) = 7,500,000 / (2,500 + 479.08) = 2,518 mm (2.52 m)
  3. Far = 3,000 × 2,500 / (2,500 − 479.08) = 7,500,000 / 2,020.92 = 3,712 mm (3.71 m)
  4. DoF = 3.71 − 2.52 = 1.19 m

Circle of confusion by sensor format

Sensor format Circle of confusion (mm) Relative DoF
Full frame (35 mm) 0.029 Shallowest
APS-C (Nikon/Canon) 0.019 Slightly deeper
Micro Four Thirds 0.015 Deeper
1-inch sensor 0.011 Deepest

Circle of confusion values are based on the assumption of an 8x10-inch print viewed at 25 cm and sensor pixel density typical for each format. Different sources quote slightly different values; the figures above represent widely accepted photographic standards.

Practical tips for controlling depth of field

To achieve a very shallow depth of field (subject isolation): use the widest aperture your lens offers (f/1.4, f/1.8, or f/2), get physically close to the subject, use a longer focal length, and put distance between the subject and the background.

To achieve maximum depth of field (landscape, architecture): focus at the hyperfocal distance for your focal length and aperture, use a narrower aperture (f/8 to f/16 for most lenses), and choose a shorter focal length. The hyperfocal distance calculator on this site can help you find the exact focus point for infinity-to-near sharpness.

Note that very narrow apertures (f/16, f/22) may introduce diffraction softening, which can reduce overall image sharpness even as geometric DoF increases. The sweet spot for most lenses is f/5.6 to f/11.

Depth of field calculator: frequently asked questions

What is depth of field?

Depth of field (DoF) is the range of subject distances in a photograph that appear acceptably sharp. Objects closer than the near focus limit or farther than the far focus limit will appear blurred. A shallow depth of field isolates the subject against a blurred background, while a large depth of field keeps foreground and background both sharp. DoF is controlled by aperture, focal length, subject distance, and sensor size.

How does aperture affect depth of field?

A wider aperture (lower f-number, such as f/1.4 or f/2) produces a shallower depth of field, blurring the background more strongly. A narrower aperture (higher f-number, such as f/11 or f/16) produces a larger depth of field, keeping more of the scene in focus. Landscape photographers often use f/8 or f/11 for maximum sharpness front to back, while portrait photographers frequently shoot at f/1.8 to f/2.8 to separate the subject from the background.

What is circle of confusion?

Circle of confusion (CoC) is the maximum size of a blur spot in an image that the human eye still perceives as a sharp point. It depends on sensor size and typical viewing conditions (standard print size, viewing distance). Full-frame cameras use a CoC of about 0.029 mm, APS-C sensors about 0.019 mm, Micro Four Thirds about 0.015 mm, and 1-inch sensors about 0.011 mm. A smaller CoC means sharpness criteria are stricter, which results in a shallower computed depth of field for the same lens settings.

What is hyperfocal distance?

Hyperfocal distance is the closest focus distance at which a lens renders objects at infinity as acceptably sharp. When you focus at the hyperfocal distance, depth of field extends from half the hyperfocal distance all the way to infinity. Landscape and street photographers use hyperfocal focusing to maximise depth of field without individually focusing on near and far subjects. The hyperfocal distance decreases with shorter focal lengths and narrower apertures.

How does sensor size affect depth of field?

A larger sensor has a larger circle of confusion, which means the same lens and aperture produce a shallower depth of field compared to a smaller sensor. However, to fill the frame with the same composition, you need a longer focal length on a larger sensor, which also reduces depth of field. Practically, a full-frame camera at f/2 produces much shallower depth of field than a Micro Four Thirds camera at f/2 with an equivalent composition, even accounting for the crop factor.

Sources

Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology. For professional optical engineering work, consult a qualified optical physicist.