Depth of field calculator

Choose your sensor, focal length, aperture and focus distance to see how much of the scene will be sharp. A 50 mm lens at f/2.8 focused at 3 m on full frame is sharp from 2.73 m to 3.33 m, a total of 0.6 m. You also get the hyperfocal distance and a table for every common aperture.

mm

The real focal length on the lens, not the 35 mm equivalent.

f/

Measured from the sensor plane; the focus distance you set.

Depth of field

0.6 m (1.97 ft)

Sharp from 2.73 m to 3.33 m

Near limit
2.73 m (8.95 ft)
Far limit
3.33 m (10.93 ft)
In front of the subject
0.27 m (0.89 ft), 45%
Behind the subject
0.33 m (1.08 ft), 55%
Hyperfocal distance
29.81 m (97.81 ft)Focus here and everything from 14.91 m to infinity is acceptably sharp
Circle of confusion used
0.03 mm
Depth of field at other apertures (50 mm lens focused at 3 m)
ApertureNear limitFar limitDepth of fieldHyperfocal
f/1.42.86 m3.16 m0.3 m59.57 m
f/22.8 m3.23 m0.43 m41.72 m
f/2.82.73 m3.33 m0.6 m29.81 m
f/42.63 m3.49 m0.87 m20.88 m
f/5.62.5 m3.74 m1.24 m14.93 m
f/82.34 m4.19 m1.85 m10.47 m
f/112.16 m4.91 m2.75 m7.63 m
f/161.92 m6.92 m5 m5.26 m
f/221.69 m13.56 m11.88 m3.84 m

Calculated in your browser; nothing you type is sent or stored. Spotted a wrong result? Tell us.

By Ahsan Khowaja · Updated 27 October 2026

How to use the depth of field calculator

  1. 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.
  2. Enter the focal length printed on the lens. Use the real focal length, not a 35 mm equivalent.
  3. Enter the aperture you plan to use, such as 2.8 for f/2.8.
  4. 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:

SensorCircle of confusion
Medium format 44 × 33 mm0.037 mm
Full frame / 35 mm film0.030 mm
APS-C (Nikon, Sony, Fujifilm, Pentax)0.020 mm
APS-C (Canon)0.019 mm
Micro Four Thirds0.015 mm
1-inch type0.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):

ApertureNear limitFar limitDepth of fieldHyperfocal
f/1.42.86 m3.16 m0.30 m59.57 m
f/22.80 m3.23 m0.43 m41.72 m
f/2.82.73 m3.33 m0.60 m29.81 m
f/42.63 m3.49 m0.87 m20.88 m
f/5.62.50 m3.74 m1.24 m14.93 m
f/82.34 m4.19 m1.85 m10.47 m
f/112.16 m4.91 m2.75 m7.63 m
f/161.92 m6.92 m5.00 m5.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 distanceNear limitFar limit
1 m0.92 m1.10 m
2 m1.68 m2.46 m
3 m2.34 m4.19 m
5 m3.39 m9.53 m
10 m5.11 minfinity

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 lengthf/5.6f/8f/11f/16
14 mm1.18 m0.83 m0.61 m0.42 m
16 mm1.54 m1.08 m0.79 m0.55 m
20 mm2.40 m1.69 m1.23 m0.85 m
24 mm3.45 m2.42 m1.77 m1.22 m
28 mm4.69 m3.29 m2.40 m1.66 m
35 mm7.33 m5.14 m3.75 m2.59 m
50 mm14.93 m10.47 m7.63 m5.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.

Questions and answers

How do you calculate depth of field?

First find the hyperfocal distance, H = f² ÷ (N × c) + f. Then the near limit is s(H − f) ÷ (H + s − 2f) and the far limit is s(H − f) ÷ (H − s), where s is the focus distance. The DoF is the far limit minus the near limit. The calculator does all of this in one step.

What affects depth of field?

Three things you control: the aperture (a smaller opening, a bigger f-number, gives more), the focus distance (further gives more) and the focal length (shorter gives more at the same distance). Sensor size matters too, through the circle of confusion and the lens you need for the same framing. A smaller sensor gives more at the same framing and f-number.

Does a crop sensor have more depth of field?

At the same framing and the same f-number, yes. A crop sensor needs a shorter lens for the same view, and that more than makes up for its smaller circle of confusion. A 50 mm f/1.8 on a 1.5× APS-C camera gives about the DoF of a 75 mm f/2.7 on full frame. The [crop factor calculator](/calculators/crop-factor-calculator) works out the equivalent aperture.

What is the best aperture for a portrait with a blurred background?

A wide aperture such as f/1.8 or f/2.8 with a short-telephoto lens gives a shallow zone. An 85 mm lens at f/1.8 focused at 2 m on full frame is sharp over only about 6 cm, enough for the eyes but not the ears. At that depth, focus on the nearest eye. Stop down to f/4 or more for groups, so every face sits inside the sharp zone.

Is everything sharp at f/8?

No, only what falls between the near and far limits. A 50 mm lens at f/8 focused at 3 m on full frame is sharp from 2.34 m to 4.19 m. To get everything sharp at f/8, focus at the hyperfocal distance, here 10.47 m, which gives sharpness from about 5.2 m to infinity.

Why does my depth of field calculator give different results from another one?

Most differences come from the circle of confusion. One calculator might use 0.03 mm for full frame and another 0.029 mm or a stricter value for high-resolution sensors. Some also measure distance from the lens rather than the sensor plane, which matters only for close-ups. Use the same circle of confusion and the results will match closely.

All image, photo and design calculators