Depth of Field Calculator – Perfect Focus for Every Shot

Use the Depth of Field Calculator to determine focus range, background blur, and hyperfocal distance for your photography. Perfect for portraits.

Results

Calculated
Result
—

What depth of field is and when to use it

Depth of field (DOF) is the zone in front of and behind your focus point that still looks acceptably sharp in a photo. It is not a hard line — sharpness fades gradually — but photographers use a "circle of confusion" threshold (the largest blur spot the eye still reads as a point) to define practical near and far limits. A shallow depth of field (a thin sharp zone with a blurry background) is the signature look of portraits shot at wide apertures like f/1.8, while a large depth of field (most of the scene in focus) is typical of landscape photography shot at f/11 or narrower.

Use this calculator before a shoot to decide what aperture, focal length, and distance combination will keep your subject sharp while blurring (or including) the background as intended. It is especially useful for macro and portrait work, where DOF can be a matter of centimeters, and for landscape work, where you want to know the hyperfocal distance that keeps everything from a certain point to infinity in focus.

The formula

The calculator first finds the hyperfocal distance, then uses it to find the near and far limits of sharp focus:

  • Hyperfocal distance H = f² ÷ (N × c) + f, where f = focal length, N = f-stop (aperture), and c = circle of confusion for the sensor size.
  • Near limit = (H × s) ÷ (H + (s − f)), where s = subject distance.
  • Far limit = (H × s) ÷ (H − (s − f)), or infinity if this denominator is zero or negative (meaning the subject is at or beyond the hyperfocal distance).

The circle of confusion (c) depends on sensor size because smaller sensors need a stricter (smaller) threshold to look equally sharp when the image is enlarged the same amount — this calculator uses 0.030 mm for full frame, 0.020 mm for APS-C, 0.015 mm for Micro Four Thirds, and 0.040 mm for medium format, standard reference values used in photography.

Worked example

For a 50mm lens at f/2.8, focused on a subject 3 meters away, on a full-frame sensor (c = 0.030 mm): Hyperfocal distance H = 50² ÷ (2.8 × 0.030) + 50 = 2500 ÷ 0.084 + 50 ≈ 29,762 + 50 = 29.81 m. Near limit = (29,811.9 × 3000) ÷ (29,811.9 + 2950) ≈ 2.73 m. Far limit = (29,811.9 × 3000) ÷ (29,811.9 − 2950) ≈ 3.33 m. That gives a total depth of field of about 3.33 − 2.73 = 0.60 m — matching what the calculator returns for these exact inputs.

Common mistakes and how to interpret the result

  • Confusing focal length with "zoom level." Enter the actual focal length in millimeters printed on the lens (e.g., 50, 85, 200), not a digital zoom multiplier or crop-adjusted "equivalent" focal length.
  • Forgetting that sensor size changes the result. The same lens and aperture produce a different depth of field on different sensor sizes because the circle of confusion — and the required enlargement to view the image — changes; always select the correct sensor format.
  • Assuming DOF is split evenly in front of and behind the subject. It is not — roughly one-third of the sharp zone typically falls in front of the focus point and two-thirds behind it, which is why the near and far limits in the example above are not symmetric around 3 m.
  • Ignoring the hyperfocal distance for landscapes. Focusing exactly at the hyperfocal distance (rather than at infinity) maximizes how much of the scene, from half that distance to infinity, appears sharp — a classic landscape technique.

Frequently Asked Questions

What is the hyperfocal distance?
It's the closest focus distance at which everything from half that distance out to infinity still appears acceptably sharp. Focusing at the hyperfocal distance is a common landscape photography technique for maximizing sharp coverage in a single shot.
Why does a wider aperture (smaller f-number) create a shallower depth of field?
A wider aperture lets in light through a larger opening, which increases the angle of light rays converging at the focus point and makes out-of-focus points blur more quickly as they move away from that plane — producing the shallow, blurred-background look often used in portraits.
Why does sensor size affect depth of field for the same lens and aperture?
Smaller sensors require more enlargement to produce the same final image size, which makes any given blur circle more visible — so the "acceptably sharp" threshold (circle of confusion) is stricter, producing a different calculated depth of field than a larger sensor with the same lens and aperture.
What happens if my subject distance is beyond the hyperfocal distance?
The far limit becomes infinity — everything from the near limit out to the horizon will appear acceptably sharp. This calculator detects that condition automatically and reports "to infinity" instead of a far-limit number.