Depth of field calculator (near, far and hyperfocal distance)
Find the near and far limits of sharp focus, the total depth of field and the hyperfocal distance from focal length, aperture, subject distance and sensor size, in metres or feet, for full frame, APS-C, Micro Four Thirds and 1-inch cameras.
Result
| Near limit | 3.39 m (11.12 ft) |
|---|---|
| Far limit | 9.53 m (31.26 ft) |
| Total depth of field | 6.14 m (20.14 ft) |
| Hyperfocal distance | 10.47 m (34.34 ft) |
Approximate: the circle of confusion is a convention that depends on print size and viewing distance, and the formulas ignore lens quirks. Use the result as a guide.
How depth of field is worked out
The hyperfocal distance is H = f² / (N × c) + f, with f the focal length, N the f-number and c the circle of confusion of the sensor. For a subject at distance s, the near limit is s(H − f) / (H + s − 2f) and the far limit is s(H − f) / (H − s); once the subject is at or beyond H, everything to infinity is acceptably sharp. Circle of confusion values are conventions, so the limits are a guide, not a guarantee.
How to use it
- Enter the Focal length in millimetres, for example 50, exactly as engraved on the lens (not the 35 mm equivalent).
- Pick the Aperture from f/1.4 to f/22, or choose a custom value and type your own f-number.
- Set the Distance unit (metres or feet) and type the Subject distance, measured from the camera sensor to the point you focus on.
- Choose the Sensor size: full frame, APS-C (Canon), APS-C (Nikon, Sony), Micro Four Thirds or 1-inch. Or pick a custom circle of confusion if you use a stricter standard.
- Read the Near limit, Far limit, Total depth of field and Hyperfocal distance, shown in metres and feet.
Worked example
A 50 mm lens on a full-frame camera at f/8 focused on a subject 5 m away. The circle of confusion is 0.030 mm, so the hyperfocal distance is 50² / (8 × 0.030) + 50 = 10,467 mm, or 10.47 m. The near limit comes out at 3.39 m and the far limit at 9.53 m, so the total depth of field is about 6.14 m. Open up to f/1.4 and focus at 2 m instead: the near limit is 1.94 m, the far limit 2.07 m, and everything sharp fits in about 13 cm. Focus at 12 m with the first settings and the far limit becomes infinity, because 12 m is beyond the hyperfocal distance.
Frequently asked questions
What is hyperfocal distance and how do I use it?
It is the closest focus distance at which everything out to infinity is acceptably sharp. Focus exactly on it and sharpness runs from half that distance to infinity. A 24 mm lens at f/8 on full frame has a hyperfocal distance of about 2.4 m, so landscape shooters focus there and get roughly 1.2 m to infinity.
Which aperture gives the most depth of field?
The smallest opening, such as f/16 or f/22, gives the most depth of field. Diffraction then softens the whole image a little, so many landscape photographers stop at f/8 to f/11 and use the hyperfocal distance instead. Depth of field also grows when you move further from the subject or use a shorter focal length.
Why does the sensor size change the result?
The circle of confusion is the largest blur spot still seen as a sharp point, and it scales with the sensor, because a smaller sensor is enlarged more for the same print. Full frame uses 0.030 mm, APS-C about 0.019 to 0.020 mm and Micro Four Thirds 0.015 mm. The smaller the circle, the shallower the depth of field.
How accurate is the result?
It is a guide, not a guarantee. The circle of confusion is a convention that assumes a certain print size and viewing distance, so a very large print or close inspection needs a smaller value, which you can enter yourself. The thin-lens formulas also ignore lens quirks such as focus breathing, and sharpness fades gradually rather than stopping at the limits.
Does focal length matter if I stay at the same distance?
Yes, a lot. The hyperfocal distance grows with the square of the focal length, so doubling it makes the hyperfocal distance about four times larger. That is why an 85 mm portrait at f/1.8 and 3 m has only about 13 cm of depth of field, whereas a 35 mm lens at f/11 and the same 3 m runs from 1.67 m to almost 15 m.
Everything is calculated in your browser: this site doesn't send what you type anywhere.