Home » Photography » Depth of Field Calculator

Depth of Field Calculator

Calculate hyperfocal distance, near and far focus limits, and total depth of field for any lens, aperture, and sensor size combination.

FREE CALCULATOR
min 10, max 1200
min 1, max 45
min 0.1, max 1000
🧮

Your results will appear here.
Enter your values and press Calculate.

How it works

Enter the focal length, aperture, focus distance and sensor size. The calculator derives the hyperfocal distance from the circle of confusion of your sensor, then computes the near and far focus limits and the total depth of field between them. When the focus distance reaches or passes the hyperfocal distance, the far limit and total depth of field show as Infinity.

H = f² / (N × c) + f; Dn = s × (H - f) / (H + s - 2f); Df = s × (H - f) / (H - s); total DoF = Df - Dn

What is depth of field

Depth of field is the zone in front of and behind your focus point that appears acceptably sharp in a photo. Focus on a friend 3 metres away and the depth of field might stretch from 2.7 m to 3.3 m: faces inside that band look crisp while everything closer or farther melts into blur.

It is not a hard wall but a gradual falloff. Points exactly at the focus distance are perfectly sharp, and sharpness fades the farther you move from it. The near focus limit and far focus limit are simply the points where the blur becomes noticeable, and the calculator finds both for your exact lens and settings. Understanding depth of field is what lets you choose a razor thin slice of focus for a portrait or edge to edge sharpness for a landscape, instead of leaving it to chance.

What controls depth of field: aperture, focal length, focus distance and sensor size

Four things control depth of field. First, aperture: a wide aperture like f/1.8 gives a shallow depth of field, while f/16 gives a deep one. Second, focal length: long telephoto lenses compress the sharp zone dramatically, which is why a 200 mm portrait lens blurs backgrounds so easily while a 24 mm wide angle keeps nearly everything sharp. Third, focus distance: the closer you focus, the shallower the depth of field becomes, which is why macro shots have paper thin focus. Fourth, sensor size: smaller sensors have a larger depth of field at the same framing, because the circle of confusion they tolerate is smaller.

The calculator combines all four. Change any one input and watch the near and far limits move: stop down the aperture and the zone widens, zoom in and it collapses, focus closer and it shrinks again. That cause and effect view is the fastest way to build an instinct for depth of field in the field.

The formula: hyperfocal distance, near and far focus limits, and total DoF

Depth of field is calculated from the hyperfocal distance, the focus distance at which everything from half that distance to infinity appears sharp. The formulas, with f as focal length, N as f-number, c as circle of confusion and s as focus distance (all in the same units):

H = f² / (N × c) + f

Dn = s × (H - f) / (H + s - 2f)

Df = s × (H - f) / (H - s)

Total depth of field (DoF) = Df - Dn

H is the hyperfocal distance, Dn the near focus limit and Df the far focus limit. If you focus at or beyond the hyperfocal distance (s >= H), the far limit is infinity and the total depth of field is infinite. The calculator evaluates these formulas in millimetres and converts the answers back to metres for display.

Worked example: 50 mm at f/2.8 on full frame, focused at 3 m

Take a 50mm lens at f/2.8 on a full frame camera (circle of confusion 0.030 mm), focused at 3 m. Work it through by hand:

1. Hyperfocal distance: H = 50² / (2.8 × 0.030) + 50 = 2500 / 0.084 + 50 = 29,811.9 mm, which is 29.81 m. 2. Near limit: Dn = 3000 × (29811.9 - 50) / (29811.9 + 3000 - 100) = 2,730.0 mm, which is 2.73 m. 3. Far limit: Df = 3000 × (29811.9 - 50) / (29811.9 - 3000) = 3,330.1 mm, which is 3.33 m. 4. Total depth of field: 3.33 - 2.73 = 0.60 m.

So with a 50 mm f/2.8 focused at 3 m, everything from 2.73 m to 3.33 m is acceptably sharp: a 60 cm slice. Enter the same numbers in the calculator above and you get hyperfocal 29.81 m, near 2.73 m, far 3.33 m and total 0.60 m, the exact hand calculation, instantly.

Hyperfocal distance and how to use it for landscape photography

The hyperfocal distance is the most practical number in landscape photography. Focus at the hyperfocal distance and everything from half that distance out to infinity is acceptably sharp, which is the deepest focus a lens can give you in a single shot.

Example: a 24mm lens at f/11 on full frame. H = 24² / (11 × 0.030) + 24 = 576 / 0.33 + 24 = 1,769.5 mm, about 1.77 m. Focus at 1.77 m and everything from 0.88 m to infinity is sharp: foreground rocks and distant mountains in one frame, no focus stacking needed.

How to use it in the field: set your lens to the hyperfocal distance the calculator reports, switch to manual focus so the camera does not refocus, and shoot at a small aperture like f/8 to f/11. It works best with wide angle lenses, where the hyperfocal distance is short; with a telephoto lens it can be hundreds of metres away, which is why landscape shooters favour wide glass.

Circle of confusion and sensor size

The circle of confusion is the largest blur spot on the sensor that still looks like a sharp point in the final image. Bigger sensors are viewed with less enlargement, so they tolerate a bigger circle of confusion, which directly changes the depth of field math through the hyperfocal formula.

Standard circle of confusion values by sensor:

Full frame: 0.030 mm APS-C: 0.020 mm Micro Four Thirds: 0.015 mm 1-inch: 0.011 mm Medium format: 0.050 mm

A smaller circle of confusion means a longer hyperfocal distance and a shallower depth of field for the same lens and aperture. That is why a Micro Four Thirds camera at f/2.8 has deeper focus than a full frame camera at f/2.8 with the same framing. The calculator stores these values for you: just pick your sensor from the list instead of looking up the number, which is where many other depth of field tools make you do manual homework.

Aperture versus depth of field comparison table

Depth of field vs aperture is the comparison photographers reach for most. Here is how the sharp zone changes with aperture for a 50 mm lens on full frame focused at 3 m (near limit, far limit, total):

f/1.4: near 2.86 m, far 3.16 m, total 0.30 m f/2: near 2.80 m, far 3.23 m, total 0.43 m f/2.8: near 2.73 m, far 3.33 m, total 0.60 m f/4: near 2.63 m, far 3.49 m, total 0.87 m f/5.6: near 2.50 m, far 3.74 m, total 1.24 m f/8: near 2.34 m, far 4.19 m, total 1.85 m f/11: near 2.16 m, far 4.91 m, total 2.75 m f/16: near 1.92 m, far 6.92 m, total 5.00 m

Each stop roughly doubles the depth of field through the middle of the range. Notice how the far limit stretches faster than the near limit: at f/16 the zone reaches from under 2 m to nearly 7 m. Run your own lens through the calculator to build the same table for the apertures you actually shoot.

Typical depth of field for common shooting scenarios

Typical depth of field values help you pick settings before you even lift the camera:

Portrait, 85 mm at f/2, subject at 3 m on full frame: only about 15 cm of sharp zone, so focus on the eyes and expect the ears to soften.

Street, 35mm at f/8, subject at 5 m: roughly 3.5 m of sharp zone, enough to keep a walking subject crisp without careful refocusing.

Landscape, 24 mm at f/11 focused at the hyperfocal distance: everything from under a metre to infinity, the classic edge to edge shot.

Macro, 100 mm at f/8, subject at 0.4 m: barely a few millimetres, which is why macro shooters use focus stacking.

These are starting points, not rules. Plug your exact lens, aperture and distance into the calculator to get your real numbers, then adjust: need more of the group sharp? Stop down or step back. Want creamier blur? Open up or move closer.

How to get a blurry background

A blurry background, the bokeh look, comes from making the depth of field shallow behind your subject. Four levers get you there:

1. Open the aperture: f/1.8 to f/2.8 is the classic portrait range. 2. Use a longer focal length: an 85 mm or 135 mm lens blurs far more than a 35 mm at the same aperture. 3. Move closer to your subject: halving the focus distance quarters the depth of field. 4. Put distance between the subject and the background: the farther the background sits beyond the far limit, the softer it renders.

Try it as a depth of field calculator exercise: enter 85 mm, f/1.8, focus 3 m, full frame, and compare with 35 mm, f/1.8, focus 3 m. The 85 mm setup gives a dramatically thinner sharp zone, which is exactly why portrait lenses are long and fast. Sensor size plays a part too: full frame blurs more easily than Micro Four Thirds at the same framing.

The one-third in front, two-thirds behind rule

Depth of field extends farther behind the focus point than in front of it, roughly one third in front and two thirds behind. Focus at 3 m with a total depth of field of 0.60 m and about 0.27 m of it lies in front (2.73 m to 3.00 m) while 0.33 m lies behind (3.00 m to 3.33 m).

The rule is a handy approximation, not a law. It holds best at moderate distances; at close focus the split is nearly even, and as you approach the hyperfocal distance the behind portion stretches toward infinity while the front portion barely grows. The calculator shows you the exact split for your settings via the near and far limits, so you can see precisely where the one third, two thirds idea holds and where it breaks down. For group photos, bias your focus point slightly in front of the middle row to use the longer behind portion for the back row.

How to use this calculator

1. Enter your focal length in millimetres, for example 50. 2. Enter your aperture as an f-number, for example 8 for f/8. 3. Enter your focus distance in metres, for example 3. 4. Pick your sensor size from the list; the correct circle of confusion is applied automatically. 5. Read the results: hyperfocal distance, near focus limit, far focus limit and total depth of field.

If the far limit and total depth of field show as Infinity, your focus distance has reached or passed the hyperfocal distance: everything from the near limit out to the horizon is sharp. For a quick depth of field chart of your lens, run the calculator once per aperture and note how the total grows with each stop.

Frequently asked questions

Depth of field is the range of distances in front of and behind your focus point that appears acceptably sharp in a photo. It is bounded by the near focus limit and the far focus limit, which the calculator computes from your focal length, aperture, focus distance and sensor size.

A wider aperture (smaller f-number) gives a shallower depth of field, and a narrower aperture (larger f-number) gives a deeper one. Each full stop roughly doubles or halves the sharp zone: at 50 mm focused at 3 m on full frame, f/2.8 gives 0.60 m of depth of field while f/8 gives 1.85 m.

A longer focal length gives a shallower depth of field when the focus distance stays the same, which is why telephoto lenses blur backgrounds so strongly. A 200 mm lens at f/4 has a far thinner sharp zone than a 24 mm lens at f/4 focused at the same distance.

The hyperfocal distance is the focus distance at which everything from half that distance to infinity appears sharp. It matters because it is the single setting that gives maximum depth of field: focus there for landscapes and everything from the near foreground to the horizon stays crisp in one shot.

The circle of confusion is the largest blur spot on the sensor that still looks like a sharp point in the final image. It depends on sensor size: full frame uses 0.030 mm, APS-C 0.020 mm, Micro Four Thirds 0.015 mm, 1-inch 0.011 mm and medium format 0.050 mm. A smaller circle of confusion means stricter sharpness standards and shallower depth of field.

Yes. Smaller sensors have a smaller circle of confusion, which lengthens the hyperfocal distance and deepens the depth of field for the same lens and aperture. That is why a Micro Four Thirds camera keeps more in focus than a full frame camera at the same f-number and framing.

The far limit shows as infinity when your focus distance reaches or passes the hyperfocal distance. At that point the depth of field formula divides by zero or less, which physically means the sharp zone extends all the way to the horizon, so the calculator reports Infinity instead of a number.

Open the aperture wide (f/1.4 to f/2.8), use a longer focal length like 85 mm, move closer to your subject, and keep the background far behind the subject. Each step thins the sharp zone; combined, they produce the creamy blurred background of portrait photography. The calculator lets you preview the exact depth of field before you shoot.

Because of how the near and far limit formulas work, the far limit always stretches faster than the near limit as focus distance grows. Roughly one third of the depth of field falls in front of the focus point and two thirds behind it. Near the hyperfocal distance the behind portion explodes toward infinity while the front portion barely changes.

The near limit is the closest distance that still looks sharp; the far limit is the farthest. The total depth of field is the distance between them. For example, with 50 mm at f/2.8 focused at 3 m on full frame, the near limit is 2.73 m, the far limit is 3.33 m, and the total depth of field is 0.60 m.

Related calculators