Calculator

Depth of field and focus-stacking calculator

Near and far limits, hyperfocal distance, and the number other calculators skip: the focus step and frame count a stack needs at your aperture.

Calculator

Depth of field, hyperfocal distance and the stacking step

Enter the lens, the aperture and either the focus distance or the magnification. The result is the sharp zone for one frame, and the step and frame count a stack needs to cover your subject.

How do you know the framing?

Distance mode uses the focal length and focus distance; magnification mode uses the reproduction ratio and already accounts for effective aperture.

Sets the circle of confusion: 0.030 mm full frame, 0.019–0.020 mm APS-C, 0.015 mm Micro Four Thirds.

mm

Actual focal length, not the full-frame equivalent.

f/

The f-number set on the lens. At high magnification the effective aperture is larger; the macro mode accounts for it.

cm

From the sensor plane to the point of focus. Used in distance mode.

×

1 = life size (1:1), 0.5 = half life size (1:2). Used in macro mode.

mm

Front to back of what must be sharp. 12 mm is a large beetle; 3 000 mm a foreground rock to a fence.

%

How much each frame's sharp zone overlaps the next. 30 % is the usual floor; 50 % is safer for a difficult subject.

The arithmetic, stated

lens, left one frame's depth of field, three frames subjectstep ≤ DoF × 0.7

Each frame is sharp in one slice as deep as the depth of field; step the focus by less than a slice and the slices overlap.

Hyperfocal distance H = f² ⁄ (N·c) + f, where f is the focal length, N the f-number and c the circle of confusion for the sensor. For a focus distance s, the near limit is s(Hf) ⁄ (H + s − 2f) and the far limit s(Hf) ⁄ (Hs), infinite once s reaches H. In macro mode, where you know the magnification m rather than the distance, the depth of field is 2·N·c·(1 + m) ⁄ m², which already contains the effective-aperture growth.

The stacking step is one frame's depth of field times (1 − overlap), and the frame count is the subject depth divided by the step, plus one, so the first and last frames sit beyond the subject. Every free depth-of-field calculator stops at the first paragraph; the second is why this one exists.

Which circle of confusion?

The values here are the conventional ones for a print viewed at normal distance. If you inspect at 100 % on a 45-megapixel sensor, halve them — and expect the frame count to double. The calculator is a planning tool; the stacker's inspector is the judge.