Focus Stacking Calculator
This calculator works out how many frames a focus stack needs and exactly where to focus each one, from your focal length, aperture, sensor format and the nearest and farthest points you want sharp — using the same depth-of-field maths as the DoF Calculator.
Frames needed
18
First focus
505 mm
Last focus
696 mm
Average focus step
11 mm
| Frame | Focus at | Sharp from | Sharp to |
|---|---|---|---|
| 1 | 505 mm | 500 mm | 510 mm |
| 2 | 513 mm | 508 mm | 518 mm |
| 3 | 521 mm | 516 mm | 527 mm |
| 4 | 530 mm | 524 mm | 535 mm |
| 5 | 539 mm | 533 mm | 545 mm |
| 6 | 548 mm | 542 mm | 554 mm |
| 7 | 558 mm | 552 mm | 564 mm |
| 8 | 568 mm | 561 mm | 574 mm |
| 9 | 578 mm | 572 mm | 585 mm |
| 10 | 589 mm | 582 mm | 596 mm |
| 11 | 600 mm | 593 mm | 608 mm |
| 12 | 612 mm | 605 mm | 620 mm |
…and 6 more, ending at 696 mm. The step grows with distance — the frames near the camera are the close ones.
Hyperfocal distance at these settings: 41.77 m. Depth of field per frame at the near end: 10 mm.
Tem uma foto disso? Receba a legenda, as hashtags e o texto alternativo.
How to use this
What it does
Steps focus from your nearest point to your farthest, one frame at a time. Each frame is placed so its depth of field starts a little way back inside the previous frame's sharp zone (the overlap), so nothing falls in a gap between frames. It uses the standard hyperfocal-distance depth-of-field formula — the same maths as the DoF Calculator — with your sensor format's circle of confusion.
What you'll need
- Focal length in mm — the actual lens focal length, not a 35mm-equivalent.
- Aperture (f-number) you'll shoot the whole stack at.
- Sensor format — sets the circle of confusion.
- The nearest and farthest points you need sharp, measured from the camera in metres.
- Overlap between neighbouring frames — 20% is a sensible default, more if your lens focus-breathes noticeably.
Steps
- Enter focal length, aperture and sensor format.
- Measure (or estimate) the nearest and farthest points that must be sharp and enter them.
- Read the frame count, then focus each frame at the distance in the table — nearest first — and shoot.
Reading the result
The frame count is the headline; the table is the shooting plan. Focus distances get further apart as you go back because depth of field grows with distance, so most of the frames sit at the near end. If the last frame says 'hyperfocal', the far point is beyond the hyperfocal distance and that final frame reaches to infinity. If the count is 1, a single frame already covers the range — no stack needed.
Tips
- Stopping down one stop roughly halves the frame count, but past f/11 on full-frame (f/8 on smaller sensors) diffraction softens everything — a stack at f/8 usually beats a single frame at f/22.
- For true macro (1:1 and closer) the standard formula becomes optimistic, because the effective aperture shrinks as magnification grows. Add overlap, or use your camera's in-body focus bracketing with a small step, and treat this as a starting point.
- Shoot the stack in one go without touching zoom, aperture or the tripod — a stacking program aligns for small shifts, but a changed framing between frames won't merge.
Learn more
What is focus stacking?
Focus stacking is shooting the same composition several times, each frame focused a little further away, then merging them so only the sharp part of each frame is kept. The result is a single image with more depth of field than any one exposure could deliver — front-to-back sharpness in a macro shot, a landscape with a sharp foreground flower and a sharp horizon, or a product photo where every edge is crisp.
The planning problem is simple to state and tedious to do by hand: each frame has a sharp zone (its depth of field) that depends on focal length, aperture, focus distance and sensor format, and the zones have to overlap so nothing between two frames is soft. This calculator does that arithmetic and hands you a list of focus distances.
Why photographers use it
Aperture alone runs out. At macro distances even f/16 gives a sliver of sharpness, and in a landscape the aperture that brings a nearby rock into focus is deep into diffraction. Stacking lets you shoot at the lens's sharpest aperture and still get everything sharp — and knowing the frame count before you start is the difference between a clean stack and finding a soft band between two frames back at the computer, when the light has gone.
How much overlap, and which aperture?
Overlap is your safety margin against three things: the circle of confusion being a convention rather than a hard line, lenses that change focal length slightly as they focus (focus breathing), and your own precision in setting each distance. 20% is a good default; use 30-40% for macro and for lenses that breathe, and you can drop to 10% for a landscape shot on a locked-down tripod. For aperture, pick the sharpest your lens offers — usually f/5.6-f/8 on full-frame, a stop wider on smaller sensors — and let the frame count absorb the rest. Only stop down further when the count gets impractical.
Common mistakes
- Stepping focus by equal distances. depth of field grows with distance, so equal steps waste frames at the far end and leave gaps at the near end. Follow the calculated distances — they bunch up close and spread out far, on purpose.
- Stacking at f/22 to keep the count down. diffraction at very small apertures softens every frame, and no amount of stacking recovers detail that was never captured. Open up to the lens's sharpest aperture and shoot more frames.
- Trusting the formula at 1:1 macro. the standard depth-of-field formula assumes the lens's marked aperture, but at high magnification the effective aperture is smaller and the geometry changes. Treat the plan as optimistic at macro distances and add overlap.
- Changing anything but focus between frames. a nudged tripod, a touched zoom ring or a different aperture makes frames that don't align. Set everything, then move only the focus — ideally with the camera's built-in focus bracketing or a rail.
- Skipping the frame beyond the far point. the last frame's depth of field needs to reach past your farthest point, not just to it. The calculator's final frame does this; if you shorten the list, you lose the far edge.
Example settings
Tabletop product shot
100mm, f/8, full-frame, sharp from 0.5 m to 2 m, 20% overlap
45 frames — about 1 cm of depth each at the front, widening to 2 cm by 2 m; a shorter range or f/11 cuts it fast
Landscape with a close foreground
24mm, f/8, full-frame, sharp from 0.4 m to infinity (enter a large far point), 20% overlap
Four frames — the last one at the hyperfocal distance (2.4 m), reaching to infinity
Close macro
100mm, f/5.6, APS-C, sharp from 0.30 m to 0.35 m, 30% overlap
44 frames barely a millimetre apart — a rail or in-body focus bracketing job
FAQ
- How do I set focus to the exact distance in the table?
- Use the camera's focus-distance readout if it has one, the lens's distance scale, or a tape measure and a marker on the subject. For stacks with many frames, most modern cameras offer in-body focus bracketing: set the number of frames and a small step and let the body move focus for you.
- Why does the last frame say 'hyperfocal'?
- Because your far point is beyond the hyperfocal distance for those settings. A frame focused at the hyperfocal distance is sharp from half that distance to infinity, so it finishes the stack in one go.
- Why does the count change so much with the near point?
- Depth of field is thinnest close to the camera. Moving the near point from 0.3 m to 0.5 m can halve the frame count, because the closest frames are the narrowest ones.
- Does this work for macro at 1:1 and beyond?
- As a starting point. The standard formula underestimates how thin the sharp zone gets at high magnification, so increase the overlap to 30-40% and check the merged result for soft bands.
- What software merges the frames?
- Any focus-stacking tool: Photoshop's auto-blend, Helicon Focus, Zerene Stacker, Affinity Photo's focus merge, and several cameras can merge in-body. The calculator only plans the capture.
Related tools
Posting this shot? Get the caption, hashtags and alt text