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.
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.
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.
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.
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.
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.
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