Depth of Field Calculator
Calculate the depth of field for any camera, lens, and aperture combination.
See near limit, far limit, and total DOF.
Depth of field (DOF) is the range of distance in a photo that appears acceptably sharp. A shallow DOF blurs the background (portraits), while a deep DOF keeps everything sharp (landscapes).
Three factors control DOF:
- Aperture (f-stop): Wider aperture (lower f-number) = shallower DOF. Narrower aperture (higher f-number) = deeper DOF.
- Focal length: Longer focal length = shallower DOF at the same subject distance.
- Subject distance: Closer to the subject = shallower DOF.
The formulas:
The hyperfocal distance H is:
H = (f² / (N × c)) + f
Near limit of acceptable sharpness:
Dn = (s × (H - f)) / (H + s - 2f)
Far limit of acceptable sharpness:
Df = (s × (H - f)) / (H - s)
Where:
- f = focal length
- N = f-number (aperture)
- c = circle of confusion (sensor-dependent)
- s = subject distance
Circle of confusion (CoC) values by sensor size:
- Full-frame (36×24mm): 0.030 mm
- APS-C (Canon): 0.019 mm
- APS-C (Nikon/Sony): 0.020 mm
- Micro Four Thirds: 0.015 mm
- 1-inch sensor: 0.011 mm
Practical DOF guidelines:
- Portrait (shallow DOF): f/1.4 - f/2.8, longer focal length, close to subject
- Group photo: f/5.6 - f/8, moderate distance
- Landscape (deep DOF): f/8 - f/16, focused at hyperfocal distance
- Macro (very shallow DOF): Even f/16 gives only millimeters of sharpness at close focus
Diffraction limit: Very small apertures (f/16 and smaller) cause diffraction blur, which reduces overall sharpness. The “sweet spot” for most lenses is f/5.6 to f/11.