By Ahsan Khowaja · Updated 27 October 2026
How to use the depth of field calculator
- Pick your sensor size. It sets the circle of confusion, the amount of blur that still counts as sharp. Choose Custom to type your own value.
- Enter the focal length printed on the lens. Use the real focal length, not a 35 mm equivalent.
- Enter the aperture you plan to use, such as 2.8 for f/2.8.
- Enter the distance to the subject you are focusing on, in metres, feet or centimetres.
You get the near and far limits of acceptable sharpness, the total DoF, how much of it falls in front of and behind the subject, and the hyperfocal distance. Below that, a table repeats the sums from f/1.4 to f/22, so you can see what stopping down does without retyping. The page works on a phone, so you can use it as a depth of field calculator app in the field without installing anything.
The focus distance on a lens scale is measured from the sensor plane, marked on many camera bodies with a circle crossed by a line. At normal distances the difference from the lens is too small to matter.
Depth of field formula
The calculator uses the standard thin-lens formulas. First the hyperfocal distance:
H = f² ÷ (N × c) + f
Then the limits for a subject at distance s:
- Near limit = s × (H − f) ÷ (H + s − 2f)
- Far limit = s × (H − f) ÷ (H − s), or infinity when s is at or beyond H
- DoF = far limit − near limit
Where:
- f is the focal length in mm.
- N is the f-number (8 for f/8).
- c is the circle of confusion in mm.
- s is the focus distance, converted to mm.
Worked examples, the same ones the calculator is tested against:
- 50 mm, f/2.8, focused at 3 m, full frame (c = 0.03 mm): H = 2,500 ÷ 0.084 + 50 = 29,812 mm (29.81 m). Near = 3,000 × 29,762 ÷ 32,712 = 2.73 m. Far = 3,000 × 29,762 ÷ 26,812 = 3.33 m. DoF 0.6 m, 45% of it in front of the subject.
- 35 mm, f/8, focused at 5 m, APS-C (c = 0.02 mm): H = 7.69 m. The sharp zone runs from 3.03 m to 14.22 m, 11.19 m in all.
- 12 mm, f/8, focused at 5 m, Micro Four Thirds (c = 0.015 mm): H is only 1.21 m. The subject is beyond it, so everything from 0.97 m to infinity is acceptably sharp.
Circle of confusion: what "sharp" means
No lens makes a point perfectly sharp except at the exact focus distance. In front and behind, each point becomes a small disc. The circle of confusion is the largest disc that still looks like a point in a normal print viewed from a normal distance. A common rule sets it at the sensor's diagonal divided by 1,500, so full frame gets about 0.029 mm, usually rounded to 0.03 mm. Wikipedia's article on the circle of confusion explains where the convention comes from.
The presets use these values:
| Sensor | Circle of confusion |
|---|---|
| Medium format 44 × 33 mm | 0.037 mm |
| Full frame / 35 mm film | 0.030 mm |
| APS-C (Nikon, Sony, Fujifilm, Pentax) | 0.020 mm |
| APS-C (Canon) | 0.019 mm |
| Micro Four Thirds | 0.015 mm |
| 1-inch type | 0.011 mm |
The choice changes the answer. If you view photos at 100% on a high-resolution screen, or make big prints, blur that passes the standard test will show. Halving c (0.015 mm on full frame) gives a stricter, smaller zone. As a Canon depth of field calculator, use the Canon APS-C preset for Canon's 1.6× bodies and the full-frame preset for full-frame Canon cameras.
Depth of field table: 50 mm at 3 m on full frame
How the sharp zone grows as you stop down, with a 50 mm lens focused at 3 m (c = 0.03 mm):
| Aperture | Near limit | Far limit | Depth of field | Hyperfocal |
|---|---|---|---|---|
| f/1.4 | 2.86 m | 3.16 m | 0.30 m | 59.57 m |
| f/2 | 2.80 m | 3.23 m | 0.43 m | 41.72 m |
| f/2.8 | 2.73 m | 3.33 m | 0.60 m | 29.81 m |
| f/4 | 2.63 m | 3.49 m | 0.87 m | 20.88 m |
| f/5.6 | 2.50 m | 3.74 m | 1.24 m | 14.93 m |
| f/8 | 2.34 m | 4.19 m | 1.85 m | 10.47 m |
| f/11 | 2.16 m | 4.91 m | 2.75 m | 7.63 m |
| f/16 | 1.92 m | 6.92 m | 5.00 m | 5.26 m |
Two patterns show up. The zone grows faster behind the subject than in front, and faster still once the far limit nears the hyperfocal distance.
f/8 depth of field at different distances
The same 50 mm lens on full frame at f/8, focused at different distances:
| Focus distance | Near limit | Far limit |
|---|---|---|
| 1 m | 0.92 m | 1.10 m |
| 2 m | 1.68 m | 2.46 m |
| 3 m | 2.34 m | 4.19 m |
| 5 m | 3.39 m | 9.53 m |
| 10 m | 5.11 m | infinity |
At 10 m the subject is just within the 10.47 m hyperfocal distance, so the far limit is technically 223 m, which for practical purposes is infinity. The old "one third in front, two thirds behind" rule is only a rough guide. Close up the split is nearer half and half, and at the hyperfocal distance everything beyond the subject is sharp.
Hyperfocal distance calculator
Focusing at the hyperfocal distance gives the most DoF a lens can give at that aperture. Everything from half that distance to infinity is acceptably sharp. Landscape photographers use it to keep both the foreground and the horizon sharp.
Example: a 24 mm lens at f/11 on full frame has H = 576 ÷ 0.33 + 24 = 1,769 mm, so 1.77 m. Focus there and the scene is sharp from about 0.88 m to infinity.
Hyperfocal distances on full frame (c = 0.03 mm):
| Focal length | f/5.6 | f/8 | f/11 | f/16 |
|---|---|---|---|---|
| 14 mm | 1.18 m | 0.83 m | 0.61 m | 0.42 m |
| 16 mm | 1.54 m | 1.08 m | 0.79 m | 0.55 m |
| 20 mm | 2.40 m | 1.69 m | 1.23 m | 0.85 m |
| 24 mm | 3.45 m | 2.42 m | 1.77 m | 1.22 m |
| 28 mm | 4.69 m | 3.29 m | 2.40 m | 1.66 m |
| 35 mm | 7.33 m | 5.14 m | 3.75 m | 2.59 m |
| 50 mm | 14.93 m | 10.47 m | 7.63 m | 5.26 m |
Small apertures such as f/16 and f/22 add DoF but soften the whole picture slightly through diffraction. Many landscape photographers stop at f/8 to f/11 for that reason.
Macro depth of field calculator
Close up, it shrinks to millimetres, and it is easier to work from magnification than distance. A good approximation for the total is:
Depth of field ≈ 2 × N × c × (m + 1) ÷ m²
Here m is the magnification (1 for life size, 0.5 for half life size). At 1:1, f/8 and c = 0.03 mm, that is 2 × 8 × 0.03 × 2 ÷ 1 = 0.96 mm. That is why macro photographers stop down further or take several shots at different focus points and stack them. The main calculator still works for close-up shots if you enter the distance from the lens, but expect small differences from your lens scale at very short range.
