Depth of Field Calculator

Enter focal length, aperture and distance to get hyperfocal distance and the near and far limits.

Depth of field calculator
Focus range

What this tool does

A depth of field calculator finds the zone that appears sharp around your focus point. Hyperfocal distance is the focal length squared divided by aperture times circle of confusion, plus the focal length; focus at it and everything from about half that distance to infinity stays sharp. A 50 mm lens at f/2.8 with a 0.03 mm circle of confusion has a hyperfocal distance of 29.8 m, so focused at 3 m the sharp zone runs from 2.73 m to 3.34 m, a total depth of 0.61 m.

Works out hyperfocal distance from focal length, aperture and circle of confusion.

Gives the near and far focus limits, and the total depth of field around them.

Switches to an infinite far limit when the subject sits at or beyond the hyperfocal distance.

Reports every distance in metres and feet, computed from millimetre inputs.

How to use it

  1. Set the focal length in millimetres.
  2. Choose the aperture from the list of standard f-stops.
  3. Enter how far away the subject is, in metres or feet.
  4. Pick the circle of confusion for your sensor, or select a custom value.
  5. Read hyperfocal distance, the near and far limits and the total depth.

Why use this tool

Depth of field decides whether the background melts away or the wedding guest three rows back lands in focus, and it is the one exposure decision that cannot be fixed afterwards. Camera screens guess at it, phone apps disagree, and the numbers printed in old lens manuals were computed for film. Working the geometry directly - focal length, aperture, distance, circle of confusion - gives one answer you can check before the shot, and an honest one when you are choosing between two lenses.

Why we built it

We built this depth of field calculator because the formulas are short but unforgiving: the hyperfocal term has to be in the same units as the distance, the focal length must be subtracted for close work, and the far limit goes singular exactly when the subject reaches the hyperfocal distance. Handling that infinity case properly is most of the value here. It also sits beside the rest of the exposure triangle: the exposure value calculator reads the light, the shutter speed calculator sets what is sharp in time as well as depth, and the image DPI converter covers the output resolution once the frame is taken.

Depth and shutter answer the same question in two domains - one for distance, one for movement - and studios usually need both.

Who this tool is for

  • Photographers planning portraits, landscapes or macro shots before they shoot
  • Cinematographers choosing an aperture for a scene's focus pull
  • Lens buyers comparing two focal lengths or two apertures
  • Students learning what hyperfocal distance actually means
  • Content planners working out what must be sharp in a product shot

How it is calculated

The three formulas

Formulas behind the depth of field figures
QuantityFormulaExample at 50 mm, f/2.8, 3 m
Hyperfocal distancef² ÷ (N × c) + f2,500 ÷ 0.084 + 50 = 29,811.9 mm = 29.8 m
Near limitH × s ÷ (H + (s − f))29,811.9 × 3,000 ÷ 32,761.9 = 2,729.9 mm = 2.73 m
Far limitH × s ÷ (H − s)29,811.9 × 3,000 ÷ 26,811.9 = 3,335.7 mm = 3.34 m
Far limit while focused at or past Hinfinity as soon as s is at or above Hnot the case at 3 m
Total depthfar limit − near limit3.34 − 2.73 = 0.61 m
Split around the subjects − near limit, then far limit − s0.27 m in front, 0.34 m behind

What the circle of confusion is

The circle of confusion is the largest blur spot still read as a point - the tolerance the answer is built on. It scales with sensor size, which is why full frame at 0.030 mm, APS-C at 0.019 mm and Micro Four Thirds at 0.015 mm give different depth for the same framing. Halve the tolerance and the numbers tighten; loosen it and depth appears to grow.

Aperture does two things at once. Stopping down buys depth, but past roughly f/11 diffraction starts softening the whole frame, so the depth figure keeps improving while the picture does not.

A worked example

Load the sample above: a 50 mm lens on a full-frame body, wide open at f/2.8, focused on a subject three metres away. The inputs are:

Example inputs for the depth of field calculator
InputValue
Focal length50 mm
Aperturef/2.8
Subject distance3 m
Circle of confusion0.030 mm - full frame

The calculator returns:

  • Hyperfocal distance: 29.8 m (97.8 ft)
  • Near limit: 2.73 m (8.96 ft)
  • Far limit: 3.34 m (10.9 ft)
  • Total depth of field: 0.61 m (1.99 ft)
  • In front of subject: 0.27 m
  • Behind subject: 0.34 m

Focus at the hyperfocal distance of 29.8 m instead and the far limit jumps to infinity: everything from about 14.9 m out stays sharp, which is how landscape photographers get a foreground rock and the horizon to hold together.

What you enter, and what you get back

Inputs and results of the depth of field calculator
ItemDetails
Focal lengthIn millimetres, as marked on the lens.
ApertureStandard f-stops from f/1.4 to f/32.
Subject distanceMetres or feet to the point of focus.
Circle of confusionSensor preset or a custom value in millimetres.
ResultHyperfocal, near limit, far limit, total depth and the split either side.
CopyThe full reading as plain text.

Issues you may run into

Common depth of field problems
What you seeWhy it happensWhat to do
Near and far limits are almost the same numberLong lens, wide aperture, close subject.Stop down a stop or step back - depth grows quickly with distance.
The far limit says infinityThe subject is at or beyond the hyperfocal distance.That is correct - focus at or before hyperfocal to reach infinity.
Depth differs from what the camera showsThe camera uses its own circle of confusion and may add diffraction.Choose the right sensor preset and treat both as approximations.
Numbers look roundedDistances are displayed to readable precision.The maths runs at full precision; only the display rounds.

Diffraction limits the useful aperture: f/22 usually looks softer than f/11 even though its calculated depth is larger. Use the depth figure to choose a framing, then check sharpness at the apertures you actually shoot.

Assumptions and limitations

Frequently asked questions

How is depth of field calculated?

Hyperfocal distance is 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 H × s ÷ (H + (s − f)) and the far limit is H × s ÷ (H − s), with the far limit becoming infinity once the subject distance reaches H.

What is hyperfocal distance?

The focus distance at which everything from half that distance to infinity appears acceptably sharp. Focus at 29.8 m with the 50 mm f/2.8 setup above and the far limit becomes infinite while the near limit falls to roughly 14.9 m.

What circle of confusion should I use?

About 0.030 mm for full frame, 0.019 mm for APS-C, 0.015 mm for Micro Four Thirds and 0.011 mm for one-inch sensors. Those are the usual defaults; stricter values give tighter numbers and looser ones more apparent depth.

How do I get everything from here to infinity in focus?

Focus at or slightly nearer than the hyperfocal distance. Any focus point beyond hyperfocal pushes the far limit past infinity, which wastes depth you could have spent on the foreground.

Why does my camera show a different depth of field?

Bodies and lenses use their own circle of confusion, may factor in diffraction, and live view can preview a simulated result. The geometry here is the same; the tolerance and the display differ.

Is the depth of field calculator free?

Yes, entirely free with no account and no upload. The calculation runs in your browser and the distances disappear with the tab.