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.

mm
How to set the circle of confusion
Sensor width × height (mm)
mm
mm
Depth of field (near limit to far limit) —
The range that looks in focus
Near limit—
Far limit—
Depth of field—
Depth in front of the focus point—
Depth behind the focus point—
Hyperfocal distance
Hyperfocal distance H—
Near limit when focused at H (H ÷ 2)—
Circle of confusion used—

This is an estimate based on the thin-lens approximation. A different circle of confusion changes the result a lot. The shooting distance is measured from the lens (strictly, from the entrance pupil).

The values copied are the near and far limits as numbers (the displayed digits, in the unit you chose).

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).

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).

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.

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

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

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.