Camera Hyperfocal Distance & Near/Far Depth of Field (DoF) Calculator

Compute optical hyperfocal distance H = f²/(N·c) and sharp depth-of-field zone.

Total Depth of Field (DoF) 0.82 m
Hyperfocal Distance (H) 29.81 m
Near Focus Limit 3.14 m
Far Focus Limit 3.96 m
Inputs
Try:
mm
Lens focal length in millimeters.
f/
Lens aperture f-number (e.g., f/2.8).
m
Focus distance to subject in meters.
mm
Sensor Circle of Confusion in mm (0.03 mm Full Frame, 0.02 mm APS-C).
Results & Graph
Total Depth of Field (DoF)
0.82 m
Hyperfocal Distance (H)
29.81 m
Near Focus Limit
3.14 m
Far Focus Limit
3.96 m

Total Depth of Field (DoF)

Graph 1 • How the inputs feed Depth of Field & Hyperfocal
Camera Hyperfocal Distance & Near/Far Depth of Field (DoF) Calculator • Custom Domain Schematic (Optics, Photonics & Acoustics) focalLen → aperturePhysical Response & Transfer Law (Depth of Field & Hyper) Focal Length Mm: 50 mm • Aperture F Stop: 2.80 f/ TOTAL DEPTH OF FIELD (DOF) 0.82 m • Hyperfocal Distance (H: 29.81 m • Near Focus Limit: 3.14 m Eq: H = f² / (N × c) + f; D_near = (
Graph 2 • Total Depth of Field (DoF) as Focal Length Mm changes (40% to 160% of current)
0 m 6.04 m 12.08 m 10.98 20mm 2.53 30mm 1.31 40mm 0.820 50mm 0.570 60mm 0.410 70mm 0.310 80mm
Graph 3 • Focal Length Mm and Aperture F Stop together Compares Total Depth of Field (DoF) when Aperture F Stop is shifted +25% (solid) vs. −25% (dashed).
0 m 1.25 m 2.51 m --- Aperture F Stop @ 75% 2.28 -30% 1.47 -15% 1.04 +0% 0.770 +15% 0.600 +30%
Summary: A 50 mm lens at f/2.8 focused at 3.5 m has a 0.82 m in-focus zone (3.14 m to 3.96 m) and hyperfocal distance 29.81 m.
Summary: A 50 mm lens at f/2.8 focused at 3.5 m has a 0.82 m in-focus zone (3.14 m to 3.96 m) and hyperfocal distance 29.81 m.
Interactive chart & math engine powered by CalculatorGraph

Formula: Depth of Field & Hyperfocal Physics & Engineering Equation

H = f² / (N × c) + f
Dnear = (s × (H − f)) / (H + s − 2f)
Dfar = (s × (H − f)) / (H − s)
H = f² / (N × c) + f; D_near = (s × (H − f)) / (H + s − 2f); D_far = (s × (H − f)) / (H − s)
  • focalLengthMm: Focal Length (mm)
  • apertureFStop: Aperture F Stop (f/)
  • subjectDistanceMeters: Subject Distance Meters (m)
  • circleOfConfusionMm: Circle Of Confusion (mm)

Rounding: Physical constants follow CODATA/NIST values; output quantities display to 2 decimal places.

Frequently Asked Questions

Why is there more depth of field behind the subject than in front?

The geometry of focus is not symmetrical. Blur grows more slowly for objects behind the focus point than for objects in front, so the far limit sits further from the subject than the near limit. In the default the zone extends about 0.36 m in front of 3.5 m and about 0.46 m behind. The imbalance increases as the focus distance grows.

What circle of confusion should I use for an APS-C camera?

A smaller value than full frame, because the image is enlarged more to reach the same viewing size. Many photographers use about 0.02 mm for APS-C. With that value and the other defaults, the calculator gives a hyperfocal distance of 44.69 m and a sharp zone of 0.54 m. Check your own viewing habits too, since larger prints need stricter values.

Do I enter the actual focal length or the full-frame equivalent?

Enter the actual focal length printed on the lens. The crop factor is handled through the circle of confusion, not by changing the focal length. Entering an equivalent focal length while keeping a full-frame circle of confusion gives the wrong answer for a crop-sensor camera, usually showing less depth of field than you will really get.

How should I measure the subject distance?

Measure from the camera to the point you focus on, in metres. The calculator uses a thin-lens model, so very small differences in where you start measuring make no visible difference at normal distances. For close-up and macro work those differences grow, and a formula based on magnification is more accurate than this one.

Why does the result switch to a distance followed by infinity?

Once the focus distance reaches the hyperfocal distance, the far limit is infinity, so there is no finite total to report. The calculator then shows only the near limit, such as 14.95 m to infinity for the default lens focused at 30 m. Everything from that near limit to the horizon is acceptably sharp at the circle of confusion you entered.

Does a smaller aperture always give a sharper photo?

No. Stopping down widens the zone of acceptable focus, but at very small apertures diffraction softens the whole image. The calculator does not model diffraction, so it will happily show more and more depth as the f-number rises. Most lenses are sharpest a couple of stops below wide open, so pick the widest aperture that gives the depth you need.

Can I use this calculator for video?

Yes. The optics are the same, so the near and far limits apply to each frame. Video is often viewed smaller and in motion, which can hide slight softness, so some cinematographers accept a larger circle of confusion. Focus pullers still use tables like this to plan how much a subject can move before leaving the sharp zone.

Why does a 30 mm lens show so much more depth than a 75 mm lens?

Focal length is squared in the hyperfocal formula. At f/2.8 and 3.5 m, the 30 mm lens gives 2.53 m of depth while the 75 mm lens gives 0.36 m. In practice you would stand further away with the longer lens to frame the same subject, which recovers a good part of the difference. Change both inputs to compare equal framing.

Is hyperfocal focusing worth it with autofocus?

For landscapes and street work it often is. Autofocus picks one point, while hyperfocal focusing sets the camera so everything from roughly half the hyperfocal distance to the horizon is acceptable. With a wide lens stopped down, that range can start close to the camera. Focus slightly beyond H rather than short of it, to keep distant detail safe.

Do the near and far limits mean everything outside is blurred?

No. Sharpness falls off gradually on either side of the focus point. The limits mark where blur reaches the circle of confusion you entered, so objects just outside look only slightly softer than objects just inside. Whether that is visible depends on how large the image is shown and how closely someone looks at it.

Why does the near limit stop at about half the hyperfocal distance?

When you focus exactly at H, the near-limit formula simplifies to H divided by two. With the default 50 mm lens at f/2.8 and a 0.03 mm circle of confusion, that is a little under 15 m. Focusing beyond H only pushes the near limit further away, and focusing short of H loses infinity, so H itself is the setting that gives the deepest zone reaching the horizon.

A 50 mm lens at f/2.8 and 3.5 m: 0.82 m of sharpness

The default describes a very ordinary shot: a standard 50 mm lens, opened up to f/2.8, focused on someone standing 3.5 m away, with a circle of confusion of 0.03 mm. The calculator says the zone of acceptable sharpness runs from 3.14 m to 3.96 m, a total depth of field of 0.82 m.

That zone is not centred on the subject. About 0.36 m of it lies in front of the focus point and about 0.46 m behind. Depth of field always extends further behind the subject than in front, and the imbalance grows as you focus further away. At close range it is nearly even. Near the hyperfocal distance it becomes wildly lopsided.

For a portrait, 0.82 m is plenty for one person and tight for a group arranged in two rows. If the back row is more than about half a metre behind the front row at this distance and aperture, someone will be soft. The usual fixes are to stop down, step back, or focus a little behind the front row so more of the zone falls where the people are.

Changing only the focus distance shows the same effect from the other side. Focus the default lens at 15 m and the zone runs from 9.98 m to 30.14 m, a total of 20.16 m. The subject moved a little over four times further away, and the depth of field grew roughly twenty-five fold, with most of the gain behind the subject.

Where 29.81 m comes from

The hyperfocal distance is the closest focus setting at which the far limit of sharpness reaches infinity. The formula on the page is H = f squared divided by N times c, plus f, with everything in millimetres.

For the default, 50 squared divided by 2.8 times 0.03 is a little under 29.8 thousand millimetres. Adding the 50 mm focal length and converting gives 29.81 m. The final plus f makes almost no difference at this scale. It matters only for very short focus distances or macro work.

Once you have H, the near and far limits follow. The near limit is the focus distance times H minus f, divided by H plus the focus distance minus twice f. The far limit uses the same top line divided by H minus the focus distance. Plugging in 3.5 m gives the 3.14 m and 3.96 m on the page. You can check either with a phone calculator in a minute.

The structure of the far-limit formula explains the behaviour near H. As the focus distance approaches H, the bottom line shrinks towards zero and the far limit shoots up. At H itself it becomes infinite.

Focal length has the strongest pull

Focal length is squared in the hyperfocal formula, so it moves the answer more than anything else. Keep f/2.8 and 3.5 m and switch the lens. At 30 mm the hyperfocal distance falls to 10.74 m and the sharp zone widens to 2.53 m, from 2.64 m to 5.18 m. At 75 mm the hyperfocal distance jumps to 67.04 m and the zone shrinks to 0.36 m, from 3.33 m to 3.69 m.

That is why landscape photographers reach for wide lenses when they want everything sharp, and why portrait photographers like longer lenses for subject separation. With an 85 mm lens at f/1.8 focused at 2 m, the calculator gives only 0.06 m of depth, from 1.97 m to 2.03 m. That is enough for the eyes and not much else, which is the look many portrait shooters want and the reason missed focus is so common with fast short telephotos.

These comparisons hold the subject distance fixed. In practice, someone switching from 30 mm to 75 mm usually steps back to keep the same framing, and that recovers much of the lost depth. The calculator answers only the question you type, so to compare equal framings, change the distance as well as the lens.

Stopping down from f/2.8

Aperture sits in the denominator, so a larger f-number shortens the hyperfocal distance and widens the zone. At the default focal length and distance, f/5.6 gives a hyperfocal distance of 14.93 m and a sharp zone of 1.72 m, from 2.84 m to 4.56 m. At f/8 the hyperfocal distance drops to 10.47 m and the zone grows to 2.6 m, from 2.63 m to 5.23 m.

Two stops of aperture roughly doubled the depth here, and three stops roughly tripled it. The relation is close to proportional while the focus distance is well short of H, which makes quick mental estimates easy.

Stopping down has costs the calculator does not show. Each stop halves the light, so you pay in shutter speed or ISO. Very small apertures also soften the whole image through diffraction, and the formula has no term for that. A landscape shot at f/22 may have enormous calculated depth and still look less crisp than the same scene at f/8.

Choosing the 0.03 mm circle of confusion

The circle of confusion is the largest blur spot that still looks like a point when the picture is viewed. It is not a property of the lens. It depends on sensor size, print or screen size, viewing distance and how fussy the viewer is.

The default 0.03 mm is the figure traditionally used for a full-frame 35 mm format at normal print sizes. Smaller sensors are enlarged more to reach the same print, so they need a smaller value. Entering 0.02 mm with the other defaults gives a hyperfocal distance of 44.69 m and a sharp zone of just 0.54 m, from 3.25 m to 3.79 m.

This is the input people most often get wrong. Using a full-frame value on a crop-sensor camera makes the depth of field look larger than it will appear in the final image. Pixel-peeping at full magnification on a high resolution sensor is even stricter: a 100 percent crop can show softness at the edges of a zone that looks fine in a print. If you routinely view at large sizes, enter a smaller value than the convention.

Using hyperfocal focus for landscapes

The classic landscape trick is to focus at the hyperfocal distance. Everything from about half that distance to infinity is then acceptably sharp. With the default lens and aperture, that would mean focusing near 29.81 m, which keeps roughly 15 m to the horizon sharp.

For a scene with foreground interest, that is often not good enough at f/2.8 on a 50 mm lens. Stop down and use a wider lens and the picture changes completely. With a 24 mm lens at f/8 the hyperfocal distance is only about 2.4 m, so focusing there keeps everything from a little over 1.2 m to the horizon sharp.

Focusing a little beyond the hyperfocal distance is safer than focusing short of it. Fall short and the far limit stops before infinity, so distant detail goes soft. Overshoot a little and you only lose a few centimetres at the near end.

Focusing at or past 29.81 m: sharp to infinity

The formula says that focusing at or beyond H puts the far limit at infinity, and the calculator now reports exactly that. When the subject distance reaches the hyperfocal distance, the headline switches from a total depth of field to the near limit, shown as a distance followed by an infinity sign.

Enter a subject distance of 30 m with the default 50 mm lens at f/2.8, just past the 29.81 m hyperfocal distance, and the page reads 14.95 m to infinity. There is no total in metres in that case, because a zone that runs to infinity has no finite length. The near limit sits close to half of H, which is the classic hyperfocal result.

Just short of H, the numbers are real but very large. A 24 mm lens at f/8 focused at 2.4 m, a touch inside its hyperfocal distance of 2.42 m, gives a far limit of a couple of hundred metres and a near limit of 1.21 m. That is the formula behaving correctly: the far limit is heading for infinity as the focus distance nears H. Move the focus out by a few centimetres and the page switches to the infinity form.

The page also rejects inputs that make no optical sense, such as a subject closer than the focal length or a zero circle of confusion, and shows an error rather than a number.

Things the depth of field formula ignores

Depth of field is a gradual fall-off in sharpness, not a wall. Objects just outside the calculated zone are only slightly softer than objects just inside it. The limits on the page are useful planning numbers, not boundaries you will see in the image.

The calculation uses a thin-lens model and treats the distance you type as measured from the lens itself. Focus scales on real lenses are measured from the sensor plane, and lens designs vary. At normal shooting distances the difference is small. At close focus and in macro work it can matter, and dedicated macro formulas that use magnification are more reliable there.

The page also ignores motion blur, diffraction, lens aberrations and focus errors. A perfectly calculated zone does nothing if the autofocus picked the ear instead of the eye. For critical work, use the numbers to choose an aperture, then check focus on the camera at full magnification before relying on it.