Crafts, Textiles, 3D Printing & Photography Photography, Optics & Printing Circle of confusion by the sensor-diagonal ÷ 1500 convention

Depth of Field Calculator

Depth of field is the zone in front of and behind your focus point that still looks acceptably sharp. It is set by four things — focal length, aperture, focus distance and the circle of confusion your sensor format implies — and this calculator returns the near limit, the far limit, the total depth, how that depth splits in front of and behind the subject, and the hyperfocal distance for those settings. It also shows how the depth changes across every full f-stop, which is usually the fastest way to decide what aperture a shot actually needs.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Focal lengthThe true focal length marked on the lens, not a 35 mm equivalent.85 mm
Aperture (f-number)The f-number you are shooting at; the true value, not a crop-factor equivalent.2.8 f/
Focus distanceDistance from the sensor plane to the subject you focused on.3 m
Sensor formatSets the circle of confusion, the blur spot small enough to read as a point in a normal-sized print.Full frame 35 mm (c = 0.029 mm)
Circle of confusionUse a smaller value for critical work or big enlargements; sensor diagonal ÷ 1500 is the usual starting point.0.02 mm

It returns

  • Total depth of field — The distance between the near and far sharp limits.
  • Near sharp limit
  • Far sharp limit
  • Depth in front of the subject
  • Depth behind the subject
  • Hyperfocal distance
  • Circle of confusion used

The formula

Dnear=s(Hf)s+H2f
Dfar=s(Hf)Hs

In plain text: H = f²/(N·c) + f; near = s(H − f)/(s + H − 2f); far = s(H − f)/(H − s)

  • HHyperfocal distance (mm)
  • fFocal length (mm)
  • Nf-number (aperture) (-)
  • cCircle of confusion for the format (mm)
  • sFocus distance from the sensor plane (mm)
  • D_near, D_farNear and far limits of acceptable sharpness (mm)

The far limit is infinite when the focus distance reaches the hyperfocal distance, because the denominator (H − s) goes to zero.

Updated Category Photography, Optics & Printing Verified against published test cases Reading time 11 min

Only one plane is truly sharp; depth of field is a tolerance

A lens focuses one distance at a time. Everything nearer or farther renders as a small disc rather than a point, and depth of field is simply the range of distances over which that disc stays small enough that a viewer calls it sharp. It is a perceptual tolerance dressed as a measurement, and every number it produces depends on the tolerance you choose.

That tolerance is the circle of confusion: the largest blur disc on the sensor that still reads as a point in the final image. The standard convention takes it as the sensor diagonal divided by about 1,500, which corresponds to roughly a 0.2 mm spot on an 8 × 10 inch print viewed at 25 cm by someone with normal vision. For full frame that is 0.029 mm; for Micro Four Thirds, 0.015 mm; for a 1-inch sensor, 0.011 mm.

Choose a different tolerance and every result changes. Pixel-peeping at 100% on a 4K monitor is a far stricter test than an 8 × 10 print, and the depth of field you see there will be roughly half of what a standard table promises. That is not an error in the table — it is a different criterion. Set the circle of confusion to match how the picture will actually be viewed.

Where the formula comes from

Everything hangs off the hyperfocal distance, H = f²/(Nc) + f. Focus there and the far limit stretches to infinity while the near limit sits at exactly H/2. It is the maximum depth any given focal length and aperture can deliver, and every other distance is a fraction of it.

The near and far limits follow from geometry. Near = s(H − f)/(s + H − 2f) and far = s(H − f)/(H − s), with all distances measured from the sensor plane. Read the far equation and the behaviour of the whole system becomes obvious: as s approaches H, the denominator (H − s) approaches zero and the far limit runs away to infinity. Beyond H it is meaningless — everything from the near limit outward is inside the criterion.

Four dependencies fall out of these expressions.

Aperture appears once, in H, so depth of field is nearly proportional to the f-number: stopping down from f/2.8 to f/5.6 roughly doubles it. Focal length appears squared, so at a fixed distance an 85 mm lens gives roughly a quarter of the depth of a 42 mm lens. Distance enters roughly as its square when the subject is far closer than H, which is why depth collapses at close range and why macro work has almost none. Circle of confusion is a direct divisor: halve it and you nearly halve the depth.

The split between front and back is not symmetric. Near the hyperfocal distance most of the depth falls behind the subject; at close range it approaches an even split. The old rule that a third lies in front and two thirds behind is only true at one particular ratio of s to H, so use the calculated split rather than the rule.

Worked example: 100 mm f/2.8 portrait at 3 metres

A head-and-shoulders portrait on full frame, 100 mm at f/2.8, subject 3 m away, using the classic c = 0.030 mm criterion.

  1. Hyperfocal distance. H = 100² ÷ (2.8 × 0.030) + 100 = 10,000 ÷ 0.084 + 100 = 119,047.6 + 100 = 119,147.6 mm = 119.15 m.
  2. Near limit. 3,000 × (119,147.6 − 100) ÷ (3,000 + 119,147.6 − 200) = 3,000 × 119,047.6 ÷ 121,947.6 = 2,928.7 mm = 2.929 m.
  3. Far limit. 3,000 × 119,047.6 ÷ (119,147.6 − 3,000) = 357,142,857 ÷ 116,147.6 = 3,074.9 mm = 3.075 m.
  4. Total depth. 3,074.9 − 2,928.7 = 146.2 mm, under 15 cm.
  5. The split. 71 mm in front of the subject, 75 mm behind — very nearly even at this distance.

That 146 mm is the whole story of shooting portraits wide open. A face is about 200 mm from the tip of the nose to the back of the head, so at f/2.8 you cannot hold both eyes and both ears sharp if the head is turned. Focus on the near eye. Stopping down to f/5.6 doubles the depth to about 293 mm, and f/8 gives about 419 mm — enough for a turned head, at the cost of a busier background.

Turning the numbers into decisions

Portraits. Work out the depth your subject needs before choosing the aperture. A single face straight on needs 100-150 mm of depth; a turned head needs 200-250 mm; two people at slightly different distances need whatever separates them plus that margin. Then read the aperture off the table rather than defaulting to wide open.

Groups. Measure the front-to-back distance of the group, focus roughly a third of the way in, and pick an aperture whose depth exceeds that spread with room to spare. Depth extends farther behind the focus point than in front at normal group distances, which is why focusing on the front row wastes depth.

Landscapes. Use the hyperfocal figure and the hyperfocal distance calculator. Focusing at infinity throws away everything from the near limit inwards; focusing at H buys you the maximum possible near-to-far range for that aperture.

Close-up. Below about ten times the focal length the thin-lens approximation used here starts to drift, because it ignores pupil magnification and the effective aperture change caused by extension. At 1:1 magnification the true depth is materially shallower than this formula suggests, and you should switch to a magnification-based calculation.

Format. A smaller sensor has a smaller circle of confusion but is normally used with a proportionally shorter lens for the same framing, and the two effects do not cancel — the net result is more depth of field for equal framing and equal f-number. Micro Four Thirds at f/2.8 gives roughly the depth of full frame at f/5.6, which the crop factor calculator quantifies as the equivalent aperture.

Total depth of field on full frame at c = 0.029 mm

Total depth in metres at each focal length, aperture and distance, computed from H = f²/(Nc) + f. Entries marked ∞ have a far limit at or beyond the hyperfocal distance.
Settingat 1 mat 3 mat 10 m
24 mm f/2.80.282.98
24 mm f/80.8513.5
35 mm f/2.80.131.2821.3
35 mm f/80.384.28
50 mm f/1.80.0410.384.6
50 mm f/2.80.0640.597.4
50 mm f/80.1851.7928.5
85 mm f/1.40.0110.1011.16
85 mm f/2.80.0220.2032.33
85 mm f/80.0630.586.8
200 mm f/2.80.0040.0360.40
200 mm f/80.0110.1021.14

Values are rounded. Because depth scales almost linearly with the f-number, you can interpolate between stops with reasonable accuracy.

The circle of confusion is a choice, not a constant

Every depth-of-field figure ever published rests on an assumption about how big the final image is and how closely it will be examined. The sensor-diagonal ÷ 1500 convention assumes an enlargement to roughly 8 × 10 inches viewed at arm's length. Print larger, crop harder, or inspect at 100% on a high-resolution monitor and the effective criterion tightens, sometimes by a factor of two or three. When a shot has to survive close inspection, halve the circle of confusion and treat the resulting depth as the honest number.

Mistakes and misconceptions

  • Believing the one-third / two-thirds rule. The split depends on how close the focus distance is to the hyperfocal distance. At close range it is nearly even; near the hyperfocal distance almost all the depth is behind.
  • Using 35 mm equivalent focal lengths. The formula wants the true focal length and the format's own circle of confusion. Entering an equivalent focal length with a crop-sensor circle of confusion double-counts the crop.
  • Assuming stopping down always helps. Past roughly f/11 on full frame, and wider on smaller formats, diffraction reduces peak sharpness even as the depth of field grows.
  • Trusting the numbers at macro distances. The thin-lens model breaks down within about ten focal lengths of the subject. Use a magnification-based formula for true close-up work.
  • Measuring distance from the front of the lens. Focus distance is measured from the sensor plane, marked on most camera bodies with a circle-and-line symbol.
  • Forgetting that focus breathing changes focal length. Many lenses shorten their effective focal length as they focus closer, so the marked number is not exactly what the formula assumes.

Depth of field, bokeh and the alternatives

Depth of field tells you what is acceptably sharp; it says nothing about how the out-of-focus areas look. That quality — bokeh — comes from aperture blade count and shape, spherical aberration correction and how the lens renders specular highlights, none of which appear in any formula here. Two lenses with identical depth of field can render backgrounds completely differently.

The related quantity photographers often actually want is background blur magnitude: how large a distant point light source renders. That depends on the physical aperture diameter (f ÷ N) and the distance ratio between subject and background, not on the depth of field number. It is why an 85 mm f/1.8 separates a subject more dramatically than a 24 mm f/1.4 despite the wider f-number, and why moving the subject away from the background works better than opening up another stop.

Two techniques sidestep the depth of field limit altogether. Focus stacking shoots a sequence at incrementally different focus distances and merges the sharp parts, which is the standard answer in macro and product work where the physical depth simply is not available. Tilt movements, on a view camera or a tilt-shift lens, rotate the plane of focus so it lies along the subject rather than parallel to the sensor — the Scheimpflug principle — which puts a receding surface entirely in focus at a wide aperture.

For the specific landscape case, focusing at the hyperfocal distance is the classical maximisation, and the hyperfocal calculator gives it directly along with a table across apertures. If you are deciding how large the result can be printed, the print size and DPI calculator connects the resolution you captured to the enlargement your sharpness criterion assumed.

Frequently asked questions

What aperture gives enough depth of field for a portrait?

Decide the depth you need first. A face photographed straight on needs roughly 100-150 mm of depth; a turned head needs 200-250 mm. At 3 m with an 85 mm lens on full frame, f/2.8 gives about 200 mm and f/4 about 290 mm. Wider than f/2 at that distance leaves less than 150 mm, which is why one eye is sharp and the other is not.

What is the circle of confusion and which value should I use?

It is the largest blur spot that still reads as a point in the finished image, and it is a viewing assumption rather than a property of the camera. The standard convention is the sensor diagonal divided by 1,500 — 0.029 mm on full frame, 0.019 mm on APS-C, 0.015 mm on Micro Four Thirds. If you inspect images at 100% or print very large, halve those figures and use the stricter answer.

Is depth of field really one third in front and two thirds behind?

Only at one particular focus distance. The split depends on the ratio of the focus distance to the hyperfocal distance: close to the subject it approaches an even 50/50, and as you approach the hyperfocal distance nearly all the depth falls behind. The calculator gives the actual split for your settings, which is more useful than the rule.

Does sensor size change depth of field?

Yes, in two opposing ways that do not cancel. A smaller sensor uses a stricter circle of confusion, which reduces depth of field, but it also needs a shorter lens for the same framing, which increases it much more strongly because focal length enters squared. Net result: for the same framing and f-number, smaller formats give more depth of field, by roughly the crop factor in equivalent f-stops.

Why does my far limit show a dash?

Because it is infinite. Once your focus distance reaches the hyperfocal distance, everything from the near limit outwards satisfies the sharpness criterion, so there is no finite far limit and no finite total depth. The near limit is still meaningful and is shown. Focus closer than the hyperfocal distance if you need a bounded far limit.

Should I stop down to f/22 for maximum sharpness front to back?

Rarely. Depth of field keeps growing, but diffraction spreads every point into an Airy disc that grows with the f-number, so peak sharpness falls. On full frame the crossover is usually around f/11 to f/16; on Micro Four Thirds it is around f/5.6 to f/8. If you need more depth than the diffraction-limited aperture gives, focus stack instead.

Does depth of field change with megapixels?

Not physically, but the criterion you should use might. More pixels let you enlarge or crop further, and if you do, the effective circle of confusion tightens and the usable depth of field shrinks accordingly. If you view every file at the same final size, resolution changes nothing. The blur is set by optics; the tolerance is set by viewing.

How do I calculate depth of field for macro photography?

Use a magnification-based formula instead of this one. Within about ten focal lengths of the subject, pupil magnification and lens extension both matter, and the thin-lens approximation overstates the depth. At life-size magnification, depth of field is often under a millimetre even at f/11, which is why focus stacking is standard practice in macro and product work.

References

  • Applied Photographic Optics, 3rd ed. (depth of field, hyperfocal distance and circles of confusion) — Focal Press
  • Photography, 12th ed. — Pearson
  • Photography - Determination of ISO speed and depth-of-field marking conventions, ISO 517 (photographic lenses - aperture and marking) — International Organization for Standardization