Calculator and Converter

Depth of field calculator

Enter the sensor size, the focal length, the aperture and the distance to your subject, and this tool calculates the depth of field.

mm
mm

Results

Enter your values to see the result.

About this tool

It shows the nearest and furthest distance that look sharp, the total depth and the hyperfocal distance. It helps with portraits, landscapes and macro photography.

How it is calculated
circle of confusion c = sensor diagonal ÷ 1500; near limit = s × f² ÷ (f² + N × c × (s − f)); far limit = s × f² ÷ (f² − N × c × (s − f)) (infinite when the bottom is zero or below); hyperfocal distance = f² ÷ (N × c) + f. f = focal length, N = f-number, s = distance to the subject.
Worked example
With Sensor size: Full frame (35 mm); Focal length: 50 mm; Aperture (f-number): 2.8; Distance unit: metres; Distance to the subject: 3, the result is: Circle of confusion: 0.02885 mm; Hyperfocal distance: 31 m; Sharp from: 2.74 m; Sharp until: 3.32 m; Total depth of field: 0.5771 m.
Good to know
The calculation uses a circle of confusion set from the sensor diagonal, the focal length, the f-number and the subject distance. The near and far limits come from the standard depth of field formulas, and the far limit is infinite when you focus at or beyond the hyperfocal distance. Sharpness is a matter of judgment, so treat the result as a guide.

Frequently asked questions

What is the hyperfocal distance?

It is the focus distance at which everything from half that distance to infinity looks acceptably sharp.

How do I get a shallower depth of field?

Use a wider aperture with a lower f-number, a longer focal length, a closer subject or a larger sensor.

Why does the sensor size matter?

A smaller sensor needs a smaller circle of confusion, because the image is enlarged more for the same print size, so the result changes with the sensor.

Related calculators