Depth of field explained: the three settings that control sharpness
How aperture, focal length, and focus distance trade against each other, plus the near and far formulas this calculator uses.
The three levers you actually control
Depth of field is set by aperture, focal length, and how far the subject sits from the lens. Stopping down to a larger f-number shrinks the aperture and deepens the sharp zone, which is why landscape shooters use f/11 or f/16. A wider focal length spreads sharpness across more of the frame, while a longer lens compresses it into a thin slice. Moving the camera closer to the subject also collapses the sharp band, which is why macro work has almost no margin for error.
Near, far, and the hyperfocal distance
This tool works in millimetres and first computes the hyperfocal distance H = focal squared divided by (f-number times circle of confusion), plus the focal length. With focus distance s it then finds the near limit as s times (H minus focal) divided by (H plus s minus twice the focal), and the far limit as s times (H minus focal) divided by (H minus s). When s is smaller than H the far limit is a finite number; when s reaches H the far limit runs to infinity. That single crossover is why the tool switches from a total depth of field figure to an unbounded result.
Why the circle of confusion matters
The circle of confusion is the largest blur spot that still reads as a sharp point in the final image. It depends on the sensor size and how large you view the picture, so a smaller sensor or a more demanding viewing standard uses a smaller value. Because the number sits in the denominator of the hyperfocal formula, a smaller circle of confusion pushes the hyperfocal distance farther out and reports a shallower depth of field. The sensor presets set a sensible default, but you can override it for pixel-peeping or for large prints.
Turning the numbers into a shot
For a landscape, focus near the hyperfocal distance the tool reports and let the near limit fall to roughly half that distance so the whole scene resolves. For a portrait, keep the aperture wide and note how thin the total depth of field becomes, then place the plane of focus on the eyes. Checking the near and far limits before you shoot tells you whether a group will all land inside the sharp zone or whether you need to stop down.