Skip to content
Toolzent

Depth of Field Calculator

Free depth of field calculator: enter focal length, aperture, focus distance and sensor to get the near limit, far limit, total DoF and hyperfocal distance.

Updated 2026-06-14 · Free · No sign-up · Runs privately in your browser

Near limit
Far limit
Total depth of field
Hyperfocal distance
Show the formula & steps

How the Depth of Field Calculator Works

This calculator tells you exactly how much of your scene will be in focus. Enter your focal length, aperture (f-number), focus distance, and your sensor format, and it instantly returns the near limit, far limit, total depth of field, and the hyperfocal distance.

Depth of field (DoF) is the zone in front of and behind your point of focus that still looks sharp. Wide apertures and long lenses produce a thin slice of sharpness for creamy background blur; small apertures and wide lenses keep almost everything crisp.

The Formula

The calculation is built on the hyperfocal distance, the focus distance at which everything from half that distance to infinity is sharp:

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

where f is the focal length, N is the f-number, and c is the circle of confusion for your sensor. From there, with focus distance s:

Near limit = s(H − f) / (H + s − 2f) Far limit = s(H − f) / (H − s) Depth of field = Far − Near

If the focus distance s is greater than or equal to H, the far limit becomes infinity.

Worked Example

A 50mm lens at f/2.8 on a full-frame body (c = 0.029mm), focused at 3 m:

  • Hyperfocal: H = 50² / (2.8 × 0.029) + 50 = 30,838 mm ≈ 30.8 m
  • Near limit = 3000(30838 − 50) / (30838 + 3000 − 100) ≈ 2.74 m
  • Far limit = 3000(30838 − 50) / (30838 − 3000) ≈ 3.32 m
  • Depth of field = 3.32 − 2.74 ≈ 0.58 m (about 58 cm)

How Each Setting Changes DoF

ChangeEffect on depth of field
Wider aperture (f/2.8 → f/1.4)Shallower (less in focus)
Smaller aperture (f/2.8 → f/11)Deeper (more in focus)
Longer focal length (50mm → 200mm)Shallower
Focus closer to subjectShallower
Smaller sensor (full frame → MFT)Deeper at the same field of view

Use a shallow depth of field for portraits to separate the subject from the background, and a deep depth of field for landscapes and architecture where front-to-back sharpness matters.

Frequently asked questions

What is depth of field in photography?+

Depth of field is the distance between the nearest and farthest objects in a scene that appear acceptably sharp. A shallow depth of field blurs the background, while a deep depth of field keeps everything from the foreground to the horizon in focus.

How is depth of field calculated?+

First find the hyperfocal distance H = f² / (N × c) + f, where f is focal length, N is the f-number and c is the circle of confusion. 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. Depth of field is the far limit minus the near limit.

What is the circle of confusion?+

The circle of confusion is the largest blur spot that still looks sharp to the eye on a final print. It depends on sensor size: roughly 0.029mm for full frame, 0.019mm for APS-C and 0.015mm for Micro Four Thirds, usually taken as the sensor diagonal divided by 1500.

What makes depth of field shallower?+

Depth of field gets shallower when you use a wider aperture (lower f-number), a longer focal length, or focus closer to the subject. To deepen it, stop down to a higher f-number, use a wider lens, or step back from the subject.

Why is my far limit shown as infinity?+

When your focus distance reaches or exceeds the hyperfocal distance, the far limit extends to infinity. Everything from the near limit out to the horizon is rendered acceptably sharp, which is why landscape shooters focus at the hyperfocal distance.