Depth of Field Calculator

The number most people want from this is not the depth of field. It is the moment they discover that a 50 mm lens at f/2.8, focused three feet away, holds a shade over two inches of sharpness — and that the group shot they took at that setting has one person in focus and two people behind them softening off.

The actual focal length marked on the lens, not the full-frame equivalent
Optional. Blank uses the common convention: 0.03 mm on full frame, scaled down by the crop factor for smaller sensors.
Optional. Shows what stopping down or opening up does to the same shot.
Depth of Field Calculator — Near and Far Limits, Hyperfocal Distance by Sensor and ApertureBuildFigure

The formula, and the one number in it that is not measured

Depth of field comes out of three inputs and one convention. The three inputs are focal length, f-number and focus distance. The convention is the circle of confusion: the largest blur circle on the sensor that a viewer will still read as a point rather than a smudge. Everything downstream of it inherits its arbitrariness.

The hyperfocal distance is H = f² / (N × c) + f, where f is the focal length in millimetres, N is the f-number and c is the circle of confusion in millimetres. Once you have H, the near limit of acceptable sharpness at focus distance s is s(H − f) / (H + s − 2f), and the far limit is s(H − f) / (H − s). That far-limit expression is the one that misbehaves: as s approaches H the denominator approaches zero and the far limit runs away to infinity, and once s is greater than H the expression goes negative. There is no negative far limit in the physical world. What has happened is that the depth of field now extends past everything, and this calculator says so rather than printing a number.

Worked through: a 50 mm lens at f/8, focused at 3 m, on full frame with c = 0.03 mm. H = 2500 / 0.24 + 50, which is 10,467 mm, about 10.5 m. The near limit is 3000 × 10,417 / 13,367 = 2,338 mm, so 2.34 m. The far limit is 3000 × 10,417 / 7,467 = 4,185 mm, so 4.19 m. Just under two metres of depth, weighted toward the back.

Circle of confusion is a convention, not a constant

The 0.03 mm figure for full frame comes from an old and reasonable chain of reasoning: an 8 by 10 inch print, viewed at about a foot, by a viewer with ordinary eyesight, who can resolve roughly a fifth of a millimetre on the print. Work that back through the enlargement factor and you land near 0.03 mm on a 36 by 24 mm frame. Smaller sensors get enlarged more to reach the same print, so the convention scales down by the crop factor: about 0.02 mm on APS-C, 0.015 mm on Micro Four Thirds.

Nothing about that chain describes how you actually look at images now. A 45-megapixel frame examined at 100 percent on a monitor is a far stricter test than an 8 by 10 print, and by that test the depth of field is meaningfully shallower than the convention says. If you routinely pixel-peep, halve the circle of confusion and see what the numbers do — the override field exists for that. The honest summary is that depth of field is a viewing-condition-dependent judgement dressed up as a measurement.

Hyperfocal focusing, and why it disappoints people

Focus at the hyperfocal distance and everything from half that distance to infinity falls within the convention. That is the classic landscape trick, and it works. What it does not do is make infinity as crisp as it would be if you focused on infinity, because infinity is sitting exactly at the far edge of acceptable, which is the definition of the worst-case blur the convention tolerates. If the distant mountain range is the subject of the picture, focus on the mountain range. Hyperfocal focusing is for when the foreground matters as much as the background.

The practical version most working photographers use is to focus about a third of the way into the scene, stop down to f/8 or f/11, and check the frame. The field of view calculator is often the more useful companion here, because the choice of lens changes the composition far more than the choice of aperture changes the depth.

Crop factor changes framing, not the depth-of-field formula

A 25 mm lens on Micro Four Thirds frames like a 50 mm lens on full frame. It does not have the depth of field of a 50 mm lens on full frame. It has the depth of field of a 25 mm lens, made slightly shallower on paper by the smaller circle of confusion. Net result: for the same framing and the same f-number, a smaller sensor gives more depth of field, by roughly the crop factor in equivalent-aperture terms. Two stops between Micro Four Thirds and full frame, about one and a third stops between APS-C and full frame.

This cuts both ways and neither is a defect. Smaller formats are easier to keep sharp front to back, which is why product and macro work often prefers them. Larger formats separate a subject from a background more easily at a given framing, which is why portrait work often prefers them. The calculator uses the actual focal length because that is what the physics uses; it reports the equivalent focal length separately, for framing only.

When to stop trusting the number

Three cases where the arithmetic above quietly stops applying. Close-up and macro work, where the subject distance approaches the focal length and the simple formulas lose accuracy — magnification-based formulas do better there. Tilt and shift lenses, where the plane of focus is no longer perpendicular to the axis and the whole idea of a near and far limit along one line breaks down. And any lens with significant focus breathing or field curvature, where the sharp zone is not a flat slab at all.

Underneath all three sits the same practical point: a magnified live view on the actual subject, and one test frame reviewed at the size you will actually deliver, settles the question faster and more reliably than any formula. Use this to decide roughly where to start, not to decide whether the shot worked.

Questions people ask

Why does the far limit sometimes say infinity instead of a number?

Because that is the correct answer. The far limit expression is s(H − f) / (H − s). When the focus distance s equals the hyperfocal distance H, the denominator is zero and the far limit is unbounded; when s is greater than H, the expression returns a negative number, which is mathematically what happens when a formula is used outside its domain rather than a physical distance behind you. In both cases the depth of field extends past everything in the frame. Calculators that print a large negative number at these settings are showing you the raw output of a formula that has stopped applying.

Is the depth of field really split one-third in front and two-thirds behind?

Only at one particular distance, and not the one people assume. The split depends on how the focus distance compares to the hyperfocal distance. Very close to the subject the split approaches even, half in front and half behind. As the focus distance grows toward the hyperfocal distance the rear portion grows without limit, so the ratio passes through one-third and two-thirds on the way and then keeps going. The calculator reports the actual split for your settings, which is more useful than the rule of thumb.

Should I change the circle of confusion from the default?

Change it if your viewing conditions differ from the assumption behind it. The default is 0.03 mm on full frame, scaled down by the crop factor, which corresponds roughly to a small print at normal viewing distance. If you deliver large prints, or you judge sharpness at 100 percent on a high-resolution monitor, use something stricter — halving the value is a reasonable starting point and it will visibly shrink the reported depth. If your output is a phone screen, the convention is already conservative. There is no correct value, only a value that matches how the image will be seen.

Does sensor resolution change depth of field?

It changes what you will accept, not what the lens projects. The optical blur at a given distance from the plane of focus is set by focal length, aperture and distance, and a higher-resolution sensor records that same blur in more detail. What changes is that the blur becomes visible at a smaller size, so the practical depth of field shrinks even though nothing optical changed. This is exactly what the circle of confusion is for: it is the knob that encodes how forgiving you intend to be.

What aperture gives the sharpest results overall?

For most lenses the peak of contrast and resolution sits somewhere around two to three stops down from wide open, often near f/5.6 to f/8 on full frame, and then diffraction starts eroding it as you continue stopping down. That means there is a genuine tension in landscape work: f/16 buys depth of field and spends peak sharpness. Which trade wins depends on whether the near foreground matters. Focus stacking sidesteps the choice entirely by shooting several frames at the sharp aperture and blending them, at the cost of anything in the scene that moves.

Related