Focus Stacking Step Calculator
Plan macro focus-stacking rail steps from magnification, aperture, overlap, and subject depth with frame counts, coverage checks, and diffraction warnings.{{ summary.heading }}
| Metric | Value | Detail | Copy |
|---|---|---|---|
| {{ row.metric }} | {{ row.value }} | {{ row.detail }} |
| Check | Status | Capture note | Copy |
|---|---|---|---|
| {{ row.check }} | {{ row.status }} | {{ row.note }} |
| Frame | Rail move | Focus plane | Sharp from | Sharp to | Note | Copy |
|---|---|---|---|---|---|---|
| {{ row.frame }} | {{ row.move }} | {{ row.position }} | {{ row.sharp_from }} | {{ row.sharp_to }} | {{ row.note }} |
| Aperture | Macro DoF | Rail step | Frames | Tradeoff | Copy |
|---|---|---|---|---|---|
| {{ row.aperture }} | {{ row.macro_dof }} | {{ row.rail_step }} | {{ row.frames }} | {{ row.tradeoff }} |
Focus stacking in macro photography uses several frames focused at different front-to-back positions, then blends the sharp parts into one image. The harder planning problem is choosing a rail move that is small enough for adjacent sharp bands to overlap, but not so small that the shoot turns into hundreds of unnecessary frames.
Macro depth of field can shrink to fractions of a millimeter. Magnification, aperture, the circle of confusion, and the final viewing target all change the usable sharp band. A subject that looks simple at 1:1 can require a much finer step at 2:1 or 5:1, even when the visible subject depth is only a few millimeters.
Rail planning is not a replacement for a test stack. It gives a repeatable starting point for controlled product, specimen, insect detail, and copy-table work. Subject motion, vibration, focus breathing, lens softness, diffraction, and stacking software choices can still decide whether the final composite holds detail cleanly.
A good step plan therefore answers three practical questions before capture: how far to move the rail, how many frames the subject depth needs, and which setup choices might make the stack fragile.
How to Use This Tool:
Start with the closest shooting setup, then adjust the optics, subject depth, and rail limits until the summary and result tables match the pass you intend to shoot.
- Choose a Setup preset. Product macro 1:1, Insect detail 2:1, Extreme macro 5:1, and Measured frame width load useful starting values, while Custom keeps the plan fully editable.
- Set Magnification source. Use Direct ratio when you already know the reproduction ratio, or From frame width after photographing a ruler at the subject plane and measuring how many millimeters span the image width.
- Select Sensor format and Sharpness target. A stricter target uses a smaller circle of confusion, so Critical crop usually reduces the macro depth of field and increases the frame count.
- Enter Magnification ratio or Measured frame width, then set Aperture, Overlap target, and Subject depth. Measure the depth that must look sharp, not empty space behind the subject.
- Set Rail increment to the smallest move your rail can repeat. Open Advanced only when you need a known settle allowance, extra guard frames, a different rail direction label, or a larger Step Ledger row cap.
- If Check the stack setup appears, fix the named input before reading the plan. Common causes are a zero or negative value, a settle allowance larger than the theoretical step, or a frame count above the rendering limit.
- Read Stack Brief for the programmed rail step and frame count, Capture Checks for warnings, Step Ledger for frame-by-frame positions, Aperture Ladder for tradeoffs, and Coverage Path for the focus-plane graph.
Interpreting Results:
Programmed rail step is the move to use between frames. It is based on the macro depth of field after the overlap target and settle allowance are applied. When a rail increment is supplied, the move is rounded down to a repeatable increment when that can be done without exceeding the target step.
Frame count is the number of captures needed to span the subject depth, plus any guard frames at the front and rear. Rail travel is the total movement across the pass. Effective aperture is useful for judging diffraction risk because high magnification makes the working f-number smaller in practical terms than the lens setting alone suggests.
- Blend-ready: the computed coverage clears the subject depth and no stronger warning has taken priority.
- Rail limit watch: the required step is smaller than the rail increment, so a real rail may not be able to make the planned move.
- Diffraction watch: the effective aperture has moved into a range where fine detail should be tested instead of assumed.
- Long stack: the frame count is high enough that flash recycle, battery life, vibration, and subject stability need planning.
- Coverage gap: the rear sharp limit does not reach the entered subject depth, so reduce the step, add guard frames, lower the settle allowance, or revisit the subject depth.
Technical Details:
Macro step planning starts with total macro depth of field, not the near and far distance equations normally used for general photography. At close range, magnification dominates the calculation. Doubling magnification does not merely halve the usable sharp band; the denominator contains magnification squared, so frame counts can rise quickly as the subject is enlarged.
The circle of confusion is the acceptable blur diameter on the sensor. The sensor-format preset supplies a starting CoC, and the sharpness target adjusts it for screen, print-safe, critical-crop, or custom inspection. A smaller CoC is stricter, which lowers the depth of field and the allowed rail step.
Formula Core:
The macro depth-of-field estimate uses aperture, circle of confusion, and magnification. All distances below are in millimeters once entered values have been normalized.
| Symbol | Meaning | Where it comes from |
|---|---|---|
| N | Nominal aperture f-number. | Aperture. |
| c | Circle of confusion in millimeters. | Sensor format and sharpness target, or custom CoC. |
| m | Magnification ratio, such as 1 for 1:1 or 2 for 2:1. | Direct ratio, or sensor width divided by measured frame width. |
| O | Overlap target in percent. | Overlap target. |
| A | Settle allowance in millimeters. | Advanced settle allowance, converted from um. |
The programmed step then respects the rail increment. If the rail increment is positive and smaller than the usable step, the step is rounded down to the nearest increment so it does not exceed the overlap target. If the required step is already smaller than the rail increment, the needed value remains visible and the rail check warns that the hardware is too coarse.
| Result or warning | Rule | Practical meaning |
|---|---|---|
| Frame count | Subject depth divided by programmed step, rounded up, plus one frame and any guard frames at both ends. | More depth, stricter sharpness, higher overlap, or higher magnification usually means more frames. |
| Coverage | First and last focus planes are extended by half the macro depth of field to estimate front and rear sharp limits. | Rear coverage should clear the subject depth before the plan is trusted. |
| Effective aperture | Nominal aperture multiplied by one plus magnification. | High magnification can push an ordinary-looking f-number into a diffraction watch zone. |
| Overlap status | Low overlap is aggressive, high overlap is heavy, and midrange overlap is treated as ready. | Low overlap saves frames but gives less room for rail error, vibration, and blend tolerance. |
| Stack length | Very high frame counts are flagged for planning before capture. | Long passes need stable lighting, a still subject, and enough time for capture and processing. |
The Step Ledger treats the first focus plane as the front guard offset when guard frames are used. In front-to-back mode, each later frame adds the programmed step; in back-to-front mode, the capture order is reversed while the physical coverage math remains the same. The Coverage Path chart samples the same focus planes and sharp limits used by the ledger.
Display rounding should not be mistaken for optical certainty. The visible values round millimeter and um output for readability, while lens design, pupil magnification, diffraction, focus breathing, subject texture, and stacking software can make a real stack behave better or worse than the planning estimate.
Accuracy Notes:
The calculation is a planning estimate for static macro subjects and measured rail moves. It does not inspect photographs, judge final blend quality, or model every lens design correction.
- Run a short calibration stack before critical work, especially when the Capture Checks tab shows rail, diffraction, overlap, or long-stack warnings.
- Use the same magnification, aperture, camera position, lighting, and rail direction during capture that you used for the plan.
- Measure subject depth along the focus travel direction. A diagonal object can need more coverage than its visible width suggests.
- No image files are uploaded or analyzed. The calculator works from the numeric setup values you enter.
Worked Examples:
Product macro at 1:1. With the Product macro 1:1 preset, full-frame print-safe sharpness, f/8, 30% overlap, 6 mm subject depth, and a 5 um rail increment, Programmed rail step is about 0.485 mm. Macro depth of field is about 0.696 mm, Frame count is 14, Rail travel is about 6.305 mm, and Effective aperture is f/16. The Coverage check is ready with a rear margin a little over 0.65 mm.
Insect detail at 2:1. With APS-C critical-crop sharpness, f/5.6, 40% overlap, 3 mm subject depth, and a 2 um rail increment, the same method gives a Programmed rail step near 0.050 mm and a Frame count of 61. The result is much finer than the 1:1 product setup because magnification squared reduces the macro depth of field.
Extreme macro at 5:1. A Micro Four Thirds critical-crop setup at f/4, 45% overlap, and 1.2 mm subject depth can still require roughly 173 frames at a 0.007 mm step. Capture Checks should be read carefully here because the long stack and f/24 effective aperture can expose vibration, flash recycle, and diffraction limits.
Troubleshooting a rail warning. If the required step is 8 um but the rail increment is 20 um, Rail increment can show Too coarse. Lower the magnification, reduce the overlap, use a wider aperture only if diffraction remains acceptable, or switch to a rail that can repeat smaller moves. Do not round the step upward without testing because that can leave soft bands between frames.
FAQ:
Should I enter magnification directly or use measured frame width?
Use direct magnification when the setup ratio is known, such as 1:1 or 2:1. Use measured frame width when you can photograph a ruler at the subject plane; the calculator derives magnification from the selected sensor width and the measured subject-space frame width.
Why does the frame count rise so fast at high magnification?
The macro depth-of-field formula divides by magnification squared. Moving from 1:1 to 2:1 can reduce the usable step sharply, and 5:1 setups often need very small rail moves even for a shallow subject.
Does a smaller aperture always make the stack better?
No. A higher aperture number increases macro depth of field and can reduce the frame count, but effective aperture also rises with magnification. Check Effective aperture and the Diffraction row before assuming f/16 or f/22 is safer.
What does a coverage gap mean?
A coverage gap means the final sharp limit does not reach the entered subject depth. Reduce the step by raising overlap, lowering settle allowance, using a finer rail increment, or adding guard frames, then check the Coverage row again.
Why does the setup error mention settle allowance?
Settle allowance is subtracted from the theoretical step. If it is equal to or larger than that step, there is no usable move left, so the plan must be corrected before a frame count can be trusted.
Does the calculator upload my photos?
No. It does not need image files. It uses typed camera, rail, and subject measurements to create a capture plan, so final sharpness still has to be confirmed with real test frames.
Glossary:
- Focus stack
- A group of frames captured at different focus positions and blended into one image with greater apparent depth of field.
- Magnification ratio
- The size of the subject image on the sensor divided by the subject's real size, such as 1:1 or 2:1.
- Circle of confusion
- The largest blur spot treated as acceptably sharp for the selected sensor format and viewing target.
- Macro depth of field
- The front-to-back sharp band estimated for one frame at the entered aperture, circle of confusion, and magnification.
- Effective aperture
- The working f-number after magnification is considered, used as a warning cue for diffraction and exposure tradeoffs.
- Rail increment
- The smallest repeatable movement your macro rail can make between frames.
- Guard frame
- An extra frame before the front point or after the rear point to add coverage margin at the ends of the stack.
References:
- D850 Tips: Focus Stacking, Nikon Professional Services.
- DoF 4.0 Reference Manual, Digital Light & Color, last updated April 13, 2026.
- Macro Camera Lenses, Cambridge in Colour.
- Effective Aperture and Macro, B&H eXplora, February 16, 2021.
- Understanding Depth of Field in Photography, Cambridge in Colour.