Photography Depth of Field Calculator
How Much of the Frame Is Actually Sharp?
Depth of field is the zone in front of and behind your focus point that still reads as acceptably sharp. It isn't a hard edge — it's governed by the circle of confusion, the largest blur spot the eye accepts as a point on a given sensor size — but it can be calculated precisely once focal length, aperture, subject distance, and sensor format are known. This calculator resolves that zone into exact near and far limits instead of the rough "stop down for more depth" guidance most photographers rely on.
The Formula
The calculation runs in two stages: first the hyperfocal distance, then the near and far limits around the actual focus point.
Near Limit = (H × s) / (H + (s − f))
Far Limit = (H × s) / (H − (s − f)) — Infinity if s ≥ H
Here f is focal length, N is the f-number, c is the circle of confusion for the sensor format, and s is subject distance. The circle of confusion values used are 0.030 mm (full frame), 0.020 mm (APS-C), 0.015 mm (Micro Four Thirds), 0.011 mm (1-inch), and 0.045 mm (medium format).
Where Depth of Field Control Matters
- Portraits — a shallow depth of field at wide apertures (f/1.4–f/2.8) separates a subject from the background; knowing the exact near/far limits prevents an eye or ear falling outside the sharp zone.
- Landscape work — stopping down to f/8–f/16 extends depth of field so foreground rocks and distant ridgelines are both sharp.
- Macro photography — at close subject distances depth of field shrinks to millimeters, so this calculation becomes essential rather than optional.
- Product and tabletop shots — confirming depth of field in advance avoids reshoots when part of a product falls outside focus.
Worked Example
A 50 mm lens on a full-frame body at f/8, focused on a subject 5 m away:
| Quantity | Value |
|---|---|
| Hyperfocal distance | 10.47 m |
| Near limit | 3.39 m |
| Far limit | 9.49 m |
| Total depth of field | 6.1 m |
Depth of field grows quickly with subject distance and aperture number, and shrinks quickly as focal length increases — the same f/8 aperture on an 85 mm lens produces a much narrower zone than on a 24 mm lens.
How to Use This Calculator
- Enter the lens focal length in millimeters.
- Enter the aperture as an f-number (for example, 2.8 or 8).
- Enter the subject distance in meters.
- Select the sensor format — Full Frame, APS-C, Micro Four Thirds, 1-inch, or Medium Format.
- Select Calculate to get the near limit, far limit, and total depth of field.
Related Calculations
For the distance that maximizes depth of field at a given aperture, see the Hyperfocal Distance Calculator. To translate sensor size into full-frame equivalent focal length and aperture, use the Camera Crop Factor Calculator.
Principles of Photographic Depth of Field and Geometric Optics
A depth of field (DoF) calculator computes the spatial zone of acceptable sharpness extending in front of and behind the primary focused subject plane. In photographic optical engineering, cinematography, and portrait photography, depth of field is governed by lens focal length (f), relative aperture f-number (N), subject focus distance (s), and camera image sensor format size (Circle of Confusion, c).
The Fundamental Circle of Confusion (c)
Light rays passing through a camera lens converge to a point at the exact focal plane; points in front or behind blur into microscopic discs known as the Circle of Confusion (CoC). Standard maximum acceptable CoC limits for standard 8×10-inch print viewing at 10 inches are:
APS-C Crop Sensor (1.5x Crop): c = 0.020 mm
Micro Four Thirds Sensor (2.0x Crop): c = 0.015 mm
The Hyperfocal Distance Equation (H)
The Hyperfocal Distance (H) is the closest focus distance at which depth of field extends from half the hyperfocal distance (H / 2) all the way to infinity (∞):
Where f is lens focal length (mm), N is aperture f-number (f/2.8 &implies; N = 2.8), and c is the circle of confusion diameter (mm).
Near and Far Focus Limits of Sharpness
Far Focus Limit (Dfar) = ( H × s ) / [ H - ( s - f ) ] (for s < H)
Total Depth of Field (ΔD) = Dfar - Dnear
Step-by-Step Worked Calculation Example
Example: Portrait Photography Depth of Field on an 85mm f/1.8 Lens
Problem: A photographer shoots a portrait using a 35mm full-frame camera (c = 0.030 mm) with an 85mm lens (f = 85.0 mm = 0.085 m) set to aperture f/1.8 (N = 1.8). The subject stands at a focus distance s = 2.50 meters (2,500 mm). Calculate: (1) The Hyperfocal Distance H; (2) The Near Focus Limit Dnear; (3) The Far Focus Limit Dfar; and (4) The total shallow Depth of Field in centimeters.
Step 1: Calculate Hyperfocal Distance (H):
H = ( 85.0 mm )² / ( 1.8 × 0.030 mm ) = 7,225 / 0.054 = 133,796 mm = 133.80 meters
Step 2: Calculate Near Focus Limit (Dnear):
Numerator = 133,796 × 2,500 = 334,490,000
Denominator = 133,796 + ( 2,500 - 85 ) = 133,796 + 2,415 = 136,211
Dnear = 334,490,000 / 136,211 = 2,455.7 mm = 2.456 meters
Step 3: Calculate Far Focus Limit (Dfar):
Denominator = 133,796 - ( 2,500 - 85 ) = 133,796 - 2,415 = 131,381
Dfar = 334,490,000 / 131,381 = 2,545.9 mm = 2.546 meters
Step 4: Compute Total Depth of Field:
ΔD = 2,545.9 mm - 2,455.7 mm = 90.2 mm = 9.02 cm (approx. 3.55 inches)
Conclusion: The portrait has an ultra-shallow depth of field of only 9.0 cm, rendering the eyes tack-sharp while creating creamy background bokeh blur.
Landscape Photography: Sizing Depth of Field for Infinite Focus
Landscape photographers maximize front-to-back sharpness by focusing the lens at the exact Hyperfocal Distance H (e.g., a 24mm wide-angle lens at f/11 on full-frame has H = 1.75 meters), guaranteeing everything from 0.88 meters (H/2) to infinite horizon mountains remains in crisp, sharp focus.
Optical Wave Diffraction Limits at Small Apertures
While stopping a lens down to small apertures (f/16, f/22) expands geometric depth of field, optical Wave Diffraction occurs as light bends around aperture iris blades. The resulting Airy Disc Diameter (d = 2.44 × λ × N) exceeds the sensor's pixel pitch, causing global image softening.
Macro photographers overcome diffraction limits by using Focus Stacking — capturing multiple frames at the lens's sharpest aperture (f/5.6 or f/8) and blending slices in software.
Tilt-Shift Lens Scheimpflug Principle
Architectural photographers utilize specialized tilt-shift lenses tilting the lens plane relative to the sensor plane, tilting the planar zone of sharpness to achieve infinite depth of field across diagonal walls at wide apertures.