How to Calculate Focus-Stack Step Size for a Given Magnification
To calculate a starting focus-stack step size, estimate the depth of field at your working magnification and aperture, then reduce it to leave overlap between frames. For a macro lens approximated as having equal entrance and exit pupils, use step size ≈ (1 − overlap) × 2Nc(1 + m) / m², where N is the nominal f-number, c is your chosen sensor-plane blur tolerance in millimetres, and m is magnification. The underlying macro depth-of-field approximation is derived in Coin Imaging’s technical explanation.
This guide is for a photographer setting physical travel increments on a focusing rail for a stationary creative subject, such as a textured ceramic detail. Magnification alone cannot determine the spacing: aperture, acceptable blur and the optical model also matter. The calculation gives you a starting point to test before capturing the complete stack.
What does focus-stack step size measure?
Here, step size means the distance the camera and fixed-focus lens move between exposures along the optical axis. Canon describes a focusing rail as a way to adjust camera position precisely in depth when capturing a stacking sequence. Keep the lens focus setting fixed while using this method. Macro Photography: How to Look Sharp!
A physical step of 0.05 mm is different from a camera menu setting called “focus step width.” Nikon explains that its D850 calculates the change in focus distance using lens information, including focal length and aperture. Its numbered settings therefore cannot be read directly as millimetres of rail travel. Focus Shift, the Basics: Stacking Focus
Choose the control method before calculating. If your rail accepts millimetres or micrometres, the following examples apply directly. If you use internal focus bracketing, use the camera’s instructions and test its numbered increments with the actual lens and aperture.
Which measurements do you need first?
Record magnification, aperture and a blur criterion. To measure magnification, photograph a ruler across the frame at your intended lens setting. Divide the physical sensor width by the subject width visible across the full image: m = sensor width / subject field width. Zerene’s documentation describes this measurement method. Use matching units and the corresponding sensor dimension. DOF Estimates For Macro/Micro (depth of field, step sizes)
For an illustrative 24 mm-wide sensor showing 12 mm across the subject, m = 24 / 12 = 2, or 2:1 magnification. Measure the field before cropping the photograph; otherwise, the sensor width and measured field no longer correspond.
Next, identify whether your aperture value is nominal or effective. With a pupil ratio of 1, effective f-number is approximately N × (1 + m). Some camera systems display an effective value already. Zerene’s calculator distinguishes these inputs, so check which one your setup supplies before entering a number. DOF Calculator
Finally, choose c, the circle-of-confusion diameter at the sensor. It expresses how much defocus blur you accept. Zerene allows this to be entered in millimetres or pixels; pixel width is sensor width divided by the number of pixels across it. For example, an illustrative 24 mm-wide, 6,000-pixel image has 0.004 mm pixels. Choosing a two-pixel defocus criterion gives c = 0.008 mm. This is a declared calculation assumption, not a universal sharpness threshold. DOF Calculator
How do you turn depth of field into a rail increment?
The geometric macro approximation, including pupil magnification, is D ≈ 2Nc(1 + m/P) / m². D is total object-space depth of field in millimetres, and P is exit-pupil diameter divided by entrance-pupil diameter. Setting P = 1 simplifies it to D ≈ 2Nc(1 + m) / m². Coin Imaging’s derivation explains the small-depth-of-field approximation behind this expression. If P is unknown, label the equal-pupil assumption rather than treating it as a measured lens property. Derivation of the Macro Depth of Field Equation
Apply overlap separately: s = (1 − o)D, where s is rail spacing and o is the fractional overlap. Thus, 30% overlap means s = 0.70D; it does not mean s = 0.30D. Zerene suggests using about 0.7 times its tabulated depth values as a practical overlap adjustment. Here, 30% is an initial test choice applied to the geometric estimate. DOF Estimates For Macro/Micro (depth of field, step sizes)
Do not halve D again: the formula already estimates the total depth around the focus plane. Also keep units consistent. When c is in millimetres, D and s are in millimetres; multiply by 1,000 to convert the resulting step to micrometres.
What does a complete calculation look like at 2:1?
Assume m = 2, nominal aperture N = 5.6, c = 0.008 mm, P = 1 and overlap o = 0.30. These are illustrative inputs, not measurements from a particular camera or lens.
- Calculate total geometric depth of field: D ≈ 2 × 5.6 × 0.008 × (1 + 2) / 2² = 0.0672 mm.
- Apply overlap: s = 0.70 × 0.0672 = 0.04704 mm.
- Convert units: 0.04704 mm = 47.04 µm.
- Choose a supported rail setting at or below that value—for example, 0.047 mm, if available—and test it.
The following comparison changes only magnification. Aperture remains nominal f/5.6, c remains 0.008 mm, P remains 1 and overlap remains 30%. The values are calculated illustrations, rounded for display.
| Magnification | Estimated geometric DOF | Starting rail step |
|---|---|---|
| 0.5:1 | 0.5376 mm | 0.3763 mm |
| 1:1 | 0.1792 mm | 0.1254 mm |
| 2:1 | 0.0672 mm | 0.0470 mm |
| 3:1 | 0.0398 mm | 0.0279 mm |
| 5:1 | 0.0215 mm | 0.0151 mm |
Under these assumptions, doubling magnification from 1:1 to 2:1 reduces spacing to 37.5% of its previous value. Recalculate after changing magnification rather than relying on a blanket rule that doubling magnification always quarters the step.
Why might another calculator recommend a larger step?
Check the optical model before comparing answers. The calculation above uses geometric defocus and an explicitly chosen c. Zerene also calculates depth of field using wave optics, accounting for diffraction. Its documented calculator recommends the larger of the classic and wave-optics values, then applies overlap. A different result can therefore reflect a different criterion rather than an arithmetic error. DOF Calculator
Avoid stopping down solely to increase spacing. Canon explains that smaller apertures increase depth of field but can reduce definition through diffraction. Choose an aperture that preserves the detail you want in individual frames, then determine the spacing for it. Macro Photography: How to Look Sharp!
Microscope objectives require particular care. Their magnification labels alone are insufficient inputs: numerical aperture matters. Zerene provides a separate NA-based table for these objectives. Use that route when your optical setup is specified by NA instead of substituting an assumed photographic f-number. DOF Estimates For Macro/Micro (depth of field, step sizes)
How many frames will cover the intended depth?
Define L as the distance between your first and last required focus-plane positions. With constant step s, calculate frames = ceil(L/s) + 1, where ceil means round upward. This counts both endpoints. It deliberately avoids relying on the outer depth-of-field margins to cover the subject.
For an illustrative L = 2.00 mm and the selected s = 0.047 mm, frames = ceil(2.00 / 0.047) + 1 = 44. Those frames contain 43 intervals and span 2.021 mm. If you extend the start or finish position, include that additional travel in L before recalculating.
Use the rounded setting actually entered into the rail controller. A frame count based on an unrounded calculation can disagree with the travel produced by the chosen increment.
How do you check the step before shooting the full stack?
Run a short calibration sequence on a tilted, finely textured surface at your chosen magnification and aperture. Zerene recommends capturing closely spaced frames, then comparing stacks made from every second, third or subsequent frame to find the largest interval that avoids visible focus banding. This provides an empirical check for your equipment and viewing requirements. DOF Estimates For Macro/Micro (depth of field, step sizes)
For example, make a test sequence at 0.020 mm. Compare the full stack with versions using every second frame and every third frame, representing 0.040 mm and 0.060 mm spacing. Keep processing settings consistent and inspect the same textured regions at your intended output size.
If a soft strip appears, inspect the source frames covering that position. When the detail never becomes sharp in any frame, try closer spacing. When a sharp source frame exists but the composite remains soft there, inspect alignment and blending before changing the rail increment. Nikon illustrates alternating sharp and soft bands caused by excessive focus-step width. Focus Shift, the Basics: Stacking Focus
Keep a record of magnification, aperture convention, blur criterion, tested spacing and output size. Start each new setup with the calculation, then retain the spacing that your short test supports. That turns a theoretical depth estimate into a repeatable setting for the photograph you want to make.
