Depth of Field (DOF) Calculator
Calculate near and far depth-of-field limits and the hyperfocal distance from focal length, aperture, focus distance, and sensor size.
Result
- Hyperfocal distance10.826 m
- Near limit2.358 m
- Far limit4.124 m
- Total DOF1.766 m
- In front of subject0.642 m
- Behind subject1.124 m
- Circle of confusion0.029 mm
Step-by-step
- Hyperfocal H = f²/(N·c) + f = 50²/(8×0.029) + 50 = 10.826 m.
- Near limit = H·s/(H + (s−f)) = 2.358 m.
- Far limit = H·s/(H − (s−f)) = 4.124 m; total DOF = 1.766 m.
How to use this calculator
- Enter the lens focal length in mm and the aperture f-number.
- Enter the focus (subject) distance in metres.
- Select your sensor format so the right circle of confusion is used.
- Read the near and far limits, total DOF, and hyperfocal distance.
About this calculator
Depth of field (DOF) is the range of distances in a photo that appear acceptably sharp. It depends on four things: the lens focal length, the aperture, how far away you focus, and the sensor format — which sets the "circle of confusion," the largest blur spot still perceived as a point. This calculator computes the near and far limits of sharpness, the total depth of field, and the hyperfocal distance: the focus distance at which everything from half that distance to infinity is sharp. Wider apertures (smaller f-numbers), longer lenses, and closer subjects all shrink the depth of field; stopping down, using a shorter lens, or focusing farther away expands it. When your focus distance reaches or exceeds the hyperfocal distance, the far limit extends to infinity.
How it works — the formula
Hyperfocal H = f²/(N·c) + f
Near limit = H·s / (H + (s − f))
Far limit = H·s / (H − (s − f)) [∞ if s ≥ H]
(f, c in mm; s = focus distance)The hyperfocal distance sets the scale of sharpness for a given focal length, aperture, and circle of confusion. Near and far limits are derived from it and the focus distance; the far limit diverges to infinity once you focus at or beyond the hyperfocal distance.
Worked examples
- Inputs:
- focal=50, aperture=8, distance=3, sensor=ff
- Output:
- H≈10.8 m, near 2.36 m, far 4.12 m, DOF≈1.77 m
- Inputs:
- focal=24, aperture=11, distance=2, sensor=ff
- Output:
- H≈1.83 m; 2 m ≥ H → far = ∞
- Inputs:
- focal=85, aperture=1.8, distance=1.5, sensor=ff
- Output:
- DOF ≈ 0.03 m (very shallow)
Limitations
- Circle of confusion is a convention (sensor diagonal ÷ 1500); your sharpness standard may differ.
- Diffraction softening at small apertures is not modelled.
- Assumes the focus distance is measured to the subject, not the sensor plane offset.
DOF is perceptual; treat the limits as guidance, not a hard sharp/blurred boundary.