What the depth of field calculator does
Depth of field is the range of distances that appear acceptably sharp in a photograph. Enter the focal length, aperture, focus distance and sensor format, and the calculator returns the near and far limits of sharpness, the total depth of field, and the hyperfocal distance. Use it to know whether both eyes in a portrait will be sharp at f/1.8, how much of a landscape f/11 will hold, or where to focus so everything from a foreground rock to infinity is acceptable. Runs in your browser.
The formulas
Hyperfocal distance H = f² / (N × c) + f
Near limit Dn = s × (H − f) / (H + s − 2f)
Far limit Df = s × (H − f) / (H − s) (infinity when s ≥ H)
Depth of field = Df − Dn
f = focal length, N = f-number, s = focus distance, c = circle of confusion
c: full frame 0.030 mm, APS-C 0.020 mm, Micro Four Thirds 0.015 mm
50 mm, f/2.8, focused at 3 m, full frame:
H = 2500 / (2.8 × 0.03) + 50 = 29,812 mm ≈ 29.8 m
Dn ≈ 2.73 m, Df ≈ 3.33 m → depth of field ≈ 0.60 mWhat changes depth of field
| Change | Effect on depth of field |
|---|---|
| Smaller aperture (higher f-number) | Deeper — roughly proportional to the f-number |
| Longer focal length, same distance | Shallower — roughly with the square of focal length |
| Closer focus distance | Shallower — roughly with the square of distance |
| Larger sensor, same framing | Shallower (the lens is longer or you are closer) |
| Same lens on a smaller sensor, same distance | Slightly deeper (stricter circle of confusion, but same optics) |
Focus distance is the lever people underestimate. A 50 mm at f/2.8 has 0.6 m of depth at 3 m but only 0.07 m at 1 m — which is why close portraits at wide apertures put one eye in focus and the other out.
Worked examples
| Setup (full frame) | Near | Far | DoF |
|---|---|---|---|
| 85 mm f/1.8, 2 m (head shot) | 1.96 m | 2.04 m | 8 cm |
| 85 mm f/5.6, 2 m | 1.88 m | 2.14 m | 26 cm |
| 35 mm f/8, 3 m (group) | 1.89 m | 7.3 m | 5.4 m |
| 24 mm f/11, 2 m (landscape) | 0.98 m | ∞ | ∞ |
| 200 mm f/4, 10 m (wildlife) | 9.4 m | 10.7 m | 1.3 m |
| 100 mm macro f/8, 0.3 m | 0.298 m | 0.302 m | 4 mm |
The circle of confusion
“Acceptably sharp” has to be defined. The convention is a blur spot small enough to look like a point on an 8 × 10 in print viewed at arm's length — about 0.03 mm on a full-frame sensor, scaled down for smaller sensors. High-resolution sensors viewed at 100% on screen are far stricter than this, so pixel-peeping shows less depth of field than the calculator reports. The numbers are a planning guide, not a guarantee of pixel-level sharpness; stop down one extra stop when critical.
Practical use
- Portraits: f/2.8–f/4 at 2 m with an 85 mm gives 15–25 cm — enough for a face, not a group. Groups need f/8 and everyone in one plane.
- Landscapes: focus at the hyperfocal distance to get from half that distance to infinity sharp; the Hyperfocal Distance Calculator is dedicated to this.
- Macro: depth is millimetres; focus stacking is the usual answer.
- Video: shallow depth looks cinematic but makes focus pulls hard; f/4 is a common compromise.
- Diffraction: beyond about f/11 on full frame (f/8 on APS-C, f/5.6 on M43) the whole image softens; deeper depth of field trades off against overall sharpness.