A depth of field calculator tells you how much of a scene will look sharp for a given lens, aperture and focus distance. Enter the focal length, the f-number, the circle of confusion and the distance to your subject, and you get the near and far limits of sharp focus, the total depth of field and the hyperfocal distance. Leave out the distance to get the hyperfocal distance on its own. It works in feet or in metres, and it runs in your browser.
How to use the depth of field calculator
- Choose US (feet) or Metric (metres).
- Enter the focal length in millimetres, and the f-number.
- Enter the circle of confusion, for example 0.03 for full frame.
- Enter the distance to the subject, or leave it blank for the hyperfocal distance only.
- Press Calculate.
What depth of field is
The Wikipedia article on depth of field defines it as the distance between the nearest and the farthest objects that are in acceptably sharp focus in an image captured with a camera.[1] The word acceptably is the key. Only one plane is truly in focus, and objects away from it blur gradually, so the limits depend on how much blur you accept. That is set by the circle of confusion, the largest blur spot that still looks like a point.[2]
The hyperfocal distance
The article on the hyperfocal distance describes it as the closest distance at which a lens can be focused while keeping objects at infinity acceptably sharp. When the lens is focused at this distance, all objects from half of the hyperfocal distance out to infinity will be acceptably sharp.[2] It gives the formula H = f² ÷ (N c) + f, where f is the focal length, N the f-number and c the circle of confusion limit. For a 50 mm lens at f/8, with a circle of confusion of 0.03 mm, which the page calls a value typically used in 35 mm photography, the result is 10,467 mm.[2] If you focus at 10.5 m, everything from about 5.2 m to infinity will be acceptably sharp.[2] The calculator gives the same figure. Because the added focal length is small, it is often left out, but the calculator includes it.
Near and far limits
For a subject at distance s, the thin-lens model gives a near limit of s(H − f) ÷ (H + s − 2f) and a far limit of s(H − f) ÷ (H − s), with H the hyperfocal distance. When s reaches H, or goes beyond it, the denominator of the far limit reaches zero and the far limit is infinity. At s = H, the near limit comes to H ÷ 2, which agrees with the page.[2] We derived these formulas from the thin-lens model and they are not copied from the pages. The calculator uses them, and the total depth of field is the far limit minus the near limit. For the 50 mm lens at f/8 focused on 3 m, the near limit is 2.34 m, the far limit is 4.19 m, and the depth of field is 1.85 m.
The page on depth of field adds that the depth of field beyond the subject is always greater than the depth in front of it. When the subject is at the hyperfocal distance or farther away, the far part is infinite.[1] The calculator shows the sharp zone in front of and behind the subject so that you can see this.
What changes the depth of field
The article says that, for a given subject framing and camera position, the depth of field is controlled by the aperture. Closing the aperture, by raising the f-number, makes the blur spots of out-of-focus points smaller and so increases the depth of field.[1] Moving closer to the subject or using a longer lens at the same distance makes it shallower. The sensor size matters too, because the circle of confusion is tied to the size of the sensor. The page notes that decreasing the size of the sensor while holding the focal length and the aperture constant will decrease the depth of field.[1] This is why you should use a circle of confusion that matches your camera.
Choosing the circle of confusion
The hyperfocal page says only that 0.03 mm is typically used in 35 mm photography.[2] For other sensors, the usual practice is to scale the value with the size of the sensor, so that an APS-C sensor, which is smaller, needs a smaller value of about 0.02 mm. That is a common rule of thumb, and it is not from the pages. If you print large or view the picture very close, a smaller value gives a stricter result. If you are not sure, try two values and compare.
Using the results
For landscapes, you can set the focus at the hyperfocal distance for your aperture, so that everything from half that distance to infinity is sharp. The page notes a curious property, that focusing at H ÷ 2 gives a depth of field from H ÷ 3 to H, and focusing at H ÷ 3 gives H ÷ 4 to H ÷ 2.[2] For portraits, you may want the opposite and use a wide aperture and a close subject to make the background blur. The calculator shows the numbers for both.
Common mistakes
- Using the same circle of confusion for every sensor. Scale it with the sensor size.
- Mixing millimetres and metres. The focal length and circle are in millimetres, and the distance is in feet or metres.
- Expecting a sharp edge. Sharpness fades gradually.
- Ignoring diffraction. Very small apertures soften the picture, which this calculator does not model.
What next
Use this often? Add Depth of Fie to your Home screen.
Frequently asked questions
What is a depth of field calculator?
A tool that finds the near and far limits of acceptably sharp focus and the hyperfocal distance for a lens, aperture and subject distance.
What is the hyperfocal distance formula?
H = f² ÷ (N c) + f. For a 50 mm lens at f/8 with c = 0.03 mm, it is about 10,467 mm.
What happens when I focus at the hyperfocal distance?
Everything from half of the hyperfocal distance to infinity is acceptably sharp.
What circle of confusion should I use?
0.03 mm is typically used for 35 mm full frame. Smaller sensors need a smaller value.
Does aperture change the depth of field?
Yes. A higher f-number makes the blur spots smaller and increases the depth of field.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.