π Focus Stacking Calculator
Steps and step size for tack-sharp macro and product stacks, front to back.
Focus steps needed
Uses the macro depth of field formula. Most accurate at 1:4 magnification and closer. Start the stack slightly in front of the subject\'s nearest point.
How to Use This Calculator
Focus stacking beats the laws of optics by combining many thin slices of sharpness into one fully sharp image. This calculator tells you exactly how many slices to shoot and how far apart to space them. Enter the depth of your subject, your lens and aperture settings, the focus distance, your sensor size, and the overlap you want between slices. The result is a concrete shooting plan: step size in millimeters and total shot count.
Measure your subject\'s depth in millimeters, from its nearest point to its farthest point. A coin lying flat is about 2 mm; a beetle can be 6 to 10 mm; a product bottle might be 60 mm.
Enter your aperture, focal length, and focus distance in millimeters. The focus distance is measured from the sensor to the subject\'s nearest point; for macro work it is often close to twice the focal length.
Pick your sensor size (it sets the circle of confusion) and an overlap of 20 to 30 percent. Read the step count and the step size, then space your shots by that distance using a focus rail or the focus ring.
Shoot one extra frame before the nearest point and one after the farthest point. Stacking software blends best when the first and last sharp zones fully cover the subject\'s extremes.
The Focus Stacking Formula, in Plain English
At macro distances, depth of field depends almost entirely on magnification and aperture, not on the lens design. The formula shows why macro shooters feel cursed: doubling the magnification cuts the depth of field to one quarter. At 1:1 with a 100mm lens at f/8 on full frame, the sharp slice is barely 0.43 mm thick. At 2:1 it shrinks to roughly 0.16 mm. No single exposure can cover a real three-dimensional subject at those magnifications, which is exactly the problem stacking solves.
Overlap is the safety margin that makes stacks merge cleanly. Each slice of sharpness has a gradual falloff, not a hard edge, so the calculator shortens the step by your overlap percentage to keep the sharp cores touching. With 25 percent overlap, a 0.43 mm depth of field becomes a 0.32 mm step, and a 5 mm beetle needs 16 shots instead of 12. Those extra shots are cheap insurance against soft bands, and storage is the only cost.
Worked Example
Photographing a 5 mm deep beetle with a 100mm macro lens at f/8, focused 200 mm from the sensor, on a full-frame camera with 25 percent overlap. Magnification m = 100 / (200 - 100) = 1.0, so this is a true 1:1 shot. Depth of field = 2 x 8 x 0.03 x (1 + 1) / 1^2 = 0.96 mm total (0.48 mm each side of the focus plane). Step size = 0.96 x (1 - 0.25) = 0.72 mm. Steps = ceil(5 / 0.72) = 7 shots. Add a buffer frame at each end and you shoot 9 frames total for a perfectly sharp beetle.
Change one variable and watch the plan shift: stop down to f/16 and the depth of field doubles to 1.92 mm, dropping the stack to 4 shots, but diffraction softens every frame. Switch to APS-C at f/8 and the smaller circle of confusion narrows the depth of field to 0.64 mm, raising the stack to 11 shots. The calculator makes these trade-offs visible before you spend an hour at the rail.
Practical Tips
Shoot the stack in manual everything: manual focus stepping, manual exposure, manual white balance, and manual flash power if you use flash. Any automatic change between frames shows up as flicker or tone shifts in the merged file. If your camera has built-in focus bracketing, enter the calculator\'s step size into the step-width setting and let the camera do the tedious part.
Vibration is the silent stack killer. Use a sturdy tripod, a remote release or the 2-second timer, and mirror lockup or electronic shutter if your camera offers it. For live insects, chill the shooting session: shoot early in the morning when they are sluggish, or work with preserved specimens while you learn the technique. In the stacking software, try both depth-map and pyramid rendering methods on the same stack; one usually handles hairs and bristles noticeably better than the other.
Frequently Asked Questions
How many focus steps do I need for a stack?
Divide your subject's depth by the usable depth of field per shot. This calculator uses the macro depth of field formula, then shrinks each step by your overlap percentage so the sharp zones always touch. At 1:1 magnification with an f/8 aperture on full frame, each shot covers about 0.4 mm, so a 5 mm deep insect needs roughly 15 to 20 steps with 20 percent overlap.
What overlap percentage should I use?
Twenty to 30 percent is the sweet spot for most stacking software like Helicon Focus or Zerene Stacker. Less than 15 percent risks soft bands between slices where nothing is perfectly sharp. More than 40 percent just wastes shutter clicks and time with little quality gain. Use 30 percent if your lens has field curvature or you are shooting near the edges of its performance.
Why does aperture matter so much in focus stacking?
In macro photography the depth of field is razor thin, often a fraction of a millimeter, and it grows directly with the f-number. Stopping down from f/4 to f/8 roughly doubles the depth of field per shot, which roughly halves the number of steps you need. The trade-off is diffraction: past about f/11 to f/16 on full frame, each frame gets softer, so f/5.6 to f/8 is the usual compromise for maximum stack quality.
Does sensor size change the number of steps?
Yes, through the circle of confusion. Smaller sensors have a smaller acceptable blur circle, which narrows the calculated depth of field and therefore demands more steps for the same subject. An APS-C camera needs roughly 1.5x the steps of a full-frame camera at the same aperture and magnification, assuming you view the final images at the same size.
Can I use this for non-macro subjects like landscapes?
Focus stacking is rarely needed for landscapes because depth of field at normal distances is generous, but the same math applies if you are shooting close-up scenes like flowers or foreground rocks. The calculator is most accurate at high magnifications (1:4 and closer). For distant subjects, the standard hyperfocal technique usually gets everything sharp in two or three shots.
Should I move the camera or the focus ring between shots?
For magnifications above about 1:1, moving the camera on a focus rail is more consistent because the focus ring changes magnification and can shift the framing. Below 1:1, turning the focus ring (or using the camera's built-in focus bracketing) is fine and much faster. Either way, keep the step size from the calculator and overlap the slices by at least 20 percent.