Free tool · runs in your browser
Depth of field calculator
Enter focal length, aperture, focus distance and sensor size to get the near and far limits of acceptable sharpness and the hyperfocal distance. The formulas are the standard thin-lens approximations, cited below.
How to use it
Type the real focal length printed on the lens (not the “equivalent”), the f-number you will shoot at, and the distance you focus on. Pick your sensor so the circle of confusion matches it; the calculator sets 0.030 mm for full-frame and divides by the crop factor for smaller sensors. If you change the circle of confusion yourself, sensor changes stop overwriting it.
The formulas
With focal length f, f-number N, circle of confusion c and focus distance s (all in millimeters):
- Hyperfocal distance: H = f² / (N·c) + f
- Near limit: Dn = s(H − f) / (H + s − 2f)
- Far limit: Df = s(H − f) / (H − s) when s < H, otherwise infinity
These are the standard thin-lens approximations listed in the Wikipedia articles below; they are accurate for normal distances and slightly optimistic at macro distances, where magnification dominates.
Examples
- 50 mm at f/8 focused at 5 m on full-frame (c = 0.030 mm): H ≈ 10.47 m, sharp from about 3.39 m to 9.53 m.
- 24 mm at f/11 on full-frame: H ≈ 1.77 m. Focus there and everything from about 0.89 m to infinity is acceptably sharp.
- 100 mm macro at f/2.8, 0.5 m: total depth of field is only a few millimeters — stop down or focus-stack.
FAQ
What circle of confusion does the calculator use?
By default 0.030 mm for full-frame (the 36 × 24 mm diagonal of 43.3 mm divided by about 1,440, a common print-viewing convention), scaled by the crop factor of the sensor you pick: 0.020 mm for APS-C at 1.5×, 0.015 mm for Micro Four Thirds. You can type your own value.
What is hyperfocal distance?
The closest focus distance at which everything from half that distance to infinity is acceptably sharp. Landscape photographers focus there to maximize front-to-back sharpness.
Why does my screen look sharper or softer than the calculator says?
Depth of field depends on how large you view the image. Zooming to 100% on a high-resolution sensor shows blur the calculator’s print-based circle of confusion accepts. Use a smaller circle of confusion if you inspect pixels.
Does sensor size change depth of field?
At the same framing and f-number, a smaller sensor gives more depth of field, because you use a shorter lens (or stand farther away) and the acceptable blur is smaller. The calculator handles this through the circle of confusion.
Sources for the math
- Wikipedia — Depth of field: DOF formulae (hyperfocal, near and far limits)
- Wikipedia — Hyperfocal distance
- Wikipedia — Circle of confusion (d/1500 convention)