Depth of Field Calculator
Enter the focal length, f-number and focus distance to find the range that looks in focus (near limit, far limit, depth of field) and the hyperfocal distance. The diagram shows how the range changes with the f-number.
Distance diagram
The axis is linear. The "∞" zone at the right end is separate from the finite distances. The person is a symbol for the focus position.
How to read the distance diagram
The diagram below the results shows the distance from the camera toward the subject along a horizontal axis. The band from the focus position (the person symbol) to the near limit and to the far limit is the range that looks in focus. In many conditions you can see that the range behind the focus point (solid) is wider than the range in front of it (hatched).
- The axis is linear (length is proportional to distance). The tick marks use the unit you chose (m, cm, mm or ft). The range of the axis is set automatically so the band is easy to read. When the left end is not 0, the camera is drawn outside the axis and the left end is cut with "//" to show that part of the axis is omitted.
- While you change only the F-number, the axis is kept. If you press the F-number buttons (F1.4 to F22) in order, the axis stays still and you can see the band grow as you stop down. The axis is rebuilt only when the band no longer fits, or when it takes less than 10% of the axis width (when it is rebuilt, the range also includes the band for two stops smaller). When you change the focal length, the distance, the circle of confusion or the unit, the axis is always rebuilt. Besides the buttons, you can type any F-number in the field.
- When the far limit is infinity (the focus distance is equal to or longer than the hyperfocal distance H), the band is drawn to the "∞" zone at the right end, with an arrow. The "∞" zone is separate from the axis of finite distances and is not at the same scale (the axis is cut with "//").
- When the depth of field is extremely shallow (a long telephoto lens, a wide aperture and so on), the band becomes thin. Its width is the real value and is not enlarged. Read the near and far limits from the diagram and the results table.
- The person is a symbol for the focus position. Its size does not represent the distance or the size of the subject.
- The diagram is an aid drawn from the numbers in the results. The results table and the copy buttons work without it.
Formulas
The calculation uses the thin-lens approximation with these formulas (f: focal length, N: f-number, c: diameter of the circle of confusion, s: focus distance).
- Hyperfocal distance H = f² ÷ (N × c) + f
- Near limit = s (H − f) ÷ (H + s − 2f)
- Far limit = s (H − f) ÷ (H − s) (when s is smaller than H; if s is equal to or larger than H, the far limit is infinity)
- Depth of field = far limit − near limit
The hyperfocal distance is the distance at which, if you focus on it, the far limit is exactly infinity. The near limit is then H ÷ 2, and everything from H ÷ 2 to infinity looks in focus. The calculation uses exact fractions, so with a directly entered circle of confusion the values, including H ÷ 2, are exact inside the calculation (the screen rounds to 7 significant digits, and a value that does not divide evenly is labeled "rounded value").
The formula for the hyperfocal distance (H = f² ÷ (N c) + f) was checked in a reference article (Wikipedia, "Hyperfocal distance"). The formulas for the near and far limits were not written in that form in the same sources, so they are derived here by solving the exact thin-lens relation for the circle of confusion (Wikipedia, "Circle of confusion"). It was checked that when s = H, the near limit is H ÷ 2 and the far limit is infinity.
How the circle of confusion (c) is set
The circle of confusion is the largest blur you still accept as "in focus". There is no standard value: it is a convention that depends on the viewing size, the viewing distance, eyesight and so on. This tool lets you set it in two ways.
- From the sensor size: the sensor diagonal divided by a divisor k. The default is diagonal ÷ 1500 (about 0.0289 mm for a 36 × 24 mm full-frame sensor). 1500 and 1730 are conventional divisors, not values set by a standard. 1730 is sometimes called the "Zeiss formula", but the reference article says it has no official source.
- Entered directly: enter the diameter of the circle of confusion in mm.
The result shows the circle of confusion that was used. Because the sensor diagonal involves a square root, when the diagonal does not divide evenly the results are "rounded values".
Assumptions of the approximation
- It is a thin-lens approximation. A real lens can give slightly different results depending on its design and focusing method.
- The shooting distance is measured from the lens (strictly, the entrance pupil) to the subject you focus on, not from the camera's sensor plane.
- Corrections for close-up (macro) shooting are not included. The closer the subject, the shallower the depth of field, and the less accurate these formulas become.
- Diffraction, aberrations, image processing and pixel size are not taken into account. The "limits" of the depth of field are a guide within a blur that increases continuously.
- The same circle of confusion is assumed at the near and far limits.
- If the shooting distance is equal to or shorter than the focal length (the lens cannot form an image), nothing can be calculated.
Examples
| Input | Result |
|---|---|
| f = 50 mm, F8, circle of confusion 0.03 mm | hyperfocal distance about 10.47 m (about 10,467 mm in the reference article's example) |
| Same, shooting distance 5 m | near limit about 3.39 m, far limit about 9.53 m |
| Same, focused at H | near limit about 5.23 m (H ÷ 2) to infinity |
Sources
- Wikipedia, "Hyperfocal distance": https://en.wikipedia.org/wiki/Hyperfocal_distance (the formula for H)
- Wikipedia, "Circle of confusion": https://en.wikipedia.org/wiki/Circle_of_confusion (the relation used to derive the near and far limits)
- Wikipedia, "Depth of field": https://en.wikipedia.org/wiki/Depth_of_field
- Wikipedia, "Zeiss formula": https://en.wikipedia.org/wiki/Zeiss_formula (the divisor 1730 has no official source)
These articles are explanatory references, not standards. They were checked on October 30, 2026, while the original version of this tool was prepared.
Frequently asked questions
How does stopping down change the depth of field?
A larger F-number (a smaller aperture) shortens the hyperfocal distance and widens the depth of field. The longer the focal length and the closer the subject, the shallower the depth of field.
Why does the result differ from the distance scale on my lens?
Because the assumed circle of confusion is different. Lens scales and depth-of-field tables are made with different criteria by each manufacturer. This tool shows the circle of confusion it used.
Can I calculate the angle of view?
Use the Camera Field of View Calculator or the 35mm Equivalent Focal Length Calculator.