Depth of field calculator
Work out exactly how much of your scene will be in focus. Enter your sensor format, focal length, aperture and subject distance, and the tool returns the near limit, far limit, total depth of field and the hyperfocal distance. It is built for photographers planning landscapes, portraits and product shots.
How it works
The calculation uses the standard optics of depth of field. First it finds the hyperfocal distance:
H = f² ÷ (N · c) + f
where f is focal length (mm), N is the f-number and c is the circle of confusion chosen for your sensor (about 0.029 mm for full frame, 0.019 mm for APS-C). From H and the subject distance s it computes the near and far limits:
near = s(H − f) ÷ (H + s − 2f) far = s(H − f) ÷ (H − s)
When s reaches or exceeds H, the far limit becomes infinity. Total depth of field is far − near.
Example
Full frame, 50 mm lens at f/2.8, subject at 3 m (c = 0.029 mm):
- Hyperfocal H ≈ 50² ÷ (2.8 × 0.029) + 50 ≈ 30.8 m
- Near limit ≈ 2.74 m, far limit ≈ 3.32 m
- Total depth of field ≈ 0.58 m (about 26 cm in front, 32 cm behind)
| Setting | Value |
|---|---|
| Focal length | 50 mm |
| Aperture | f/2.8 |
| Subject distance | 3 m |
| Total DoF | ~0.58 m |
All calculations happen entirely in your browser and nothing is sent anywhere.