Where should you focus to get a landscape sharp from front to back?
Pick your sensor, focal length and aperture to find the hyperfocal distance, plus the near and far limits of depth of field for any focus distance. Switch between metres and feet.
How the tool works
The hyperfocal distance is the closest focus distance that keeps infinity acceptably sharp. This tool uses H = f squared / (N x c) + f, where f is the focal length, N the f-number and c the circle of confusion. Focus at H and everything from H/2 to infinity falls inside the depth of field. For a 24 mm lens at f/8 on full frame, H is about 2.5 m, so the sharp zone runs from 1.25 m to infinity.
The circle of confusion is the largest blur spot you accept as sharp. The values here are roughly the sensor diagonal divided by 1500, rounded to common table figures: 0.029 mm for full frame, 0.019 and 0.020 mm for APS-C, 0.015 mm for Micro Four Thirds and 0.037 mm for 44×33 medium format. They suit normal viewing of a medium sized print. For large prints or pixel peeping, stop down a little or focus slightly beyond H.
Stopping down widens depth of field but diffraction softens the image once the Airy disk (2.44 x 0.00055 mm x f-number) grows larger than the circle of confusion. The calculator shows that f-number for your sensor and warns you when you pass it. The limits come from a simple model, not a lens test, so treat them as a good starting point and check a shot at 100 percent.
Questions
What is hyperfocal distance?
It is the focus distance at which everything from half that distance to infinity is acceptably sharp, for a given focal length, aperture and sensor.
Does the hyperfocal distance change with sensor size?
Yes. A smaller sensor uses a smaller circle of confusion, so the same focal length and aperture give a longer hyperfocal distance.
Why is the far limit infinity?
If you focus at or beyond the hyperfocal distance, the far limit is infinite, so everything behind the near limit is acceptably sharp.
More photography tools: Long Exposure Calculator · Focal Length Field of View Calculator