UTILS.
100% in-browser
📷

Depth of Field Calculator

Find hyperfocal distance, near and far focus limits and total depth of field from sensor, focal length, aperture and distance.

About this tool

Depth of Field Calculator is a free, in-browser tool that works out how much of your scene will be acceptably sharp. Pick your sensor format, then enter focal length, aperture (f-number) and focus distance to get the hyperfocal distance, the near and far limits of sharp focus, and the total depth of field. Everything is computed locally — nothing is uploaded.

The circle of confusion (CoC) for the chosen sensor sets the sharpness threshold. The hyperfocal distance is H = f²/(N·c) + f, where f is focal length, N the f-number and c the CoC. With the focus distance s converted to the same units, the near limit is H·s/(H + (s − f)) and the far limit is H·s/(H − (s − f)); when s − f reaches or exceeds H the far limit becomes infinity and everything beyond the near limit is sharp.

Use it to plan landscapes (focus at the hyperfocal distance for front-to-infinity sharpness) or portraits (open the aperture to shrink depth of field). Switch between metres and feet, and watch every value update as you change the aperture.

Frequently asked questions

What is the circle of confusion and why does the sensor matter?
The circle of confusion is the largest blur spot that still looks sharp in the final image. Smaller sensors use a smaller CoC (0.030 mm full frame down to about 0.011 mm on a 1-inch sensor), which is why the same lens and aperture give different depth of field on different bodies.
How is the hyperfocal distance calculated?
It uses H = f²/(N·c) + f, with focal length f and circle of confusion c in millimetres and N the f-number. Focusing at H makes everything from half that distance to infinity acceptably sharp — the deepest possible depth of field for that aperture.
Why does the far limit sometimes show ∞?
When the focus distance minus the focal length is greater than or equal to the hyperfocal distance, the far limit extends to infinity. The tool then shows ∞ for the far limit and total depth of field and adds a note.
Is my data sent anywhere?
No. All optics math runs entirely in your browser; the focal length, aperture and distance you type never leave your device.

More tools