Depth of Field Calculator

Calculate depth of field for any camera and lens. Get the near and far focus limits, total DOF and hyperfocal distance in metres or feet.

Full frame, APS-C, Micro Four Thirds, phones and film, in metres or feet

Depth of field -  
Near limit-
Far limit-
Hyperfocal-

In front - Behind -

Camera sensor

Empty uses the sensor diagonal / 1500.

Depth of Field Calculator for Any Camera and Lens

Pick your camera sensor, type the focal length, set the aperture and enter how far away the subject is. The calculator answers as you type: the total depth of field in big type, the near and far limits of acceptable sharpness, the hyperfocal distance and how much of the sharp zone falls in front of and behind the subject. A 50 mm lens at f/2.8 focused at 3 m on full frame is sharp from 2.74 m to 3.32 m, 0.58 m in all, 45% of it in front of the subject and 55% behind.

The diagram under the numbers is a distance scale from the camera: the shaded band is the zone that comes out sharp, the dark line is the subject and the dashed H marks the hyperfocal distance when it fits on the scale. Drag the aperture slider and the band grows and shrinks in front of you. Every number copies with a click, and the m / ft switch works in metres or feet, converting the distance you typed so the answer stays the same.

Hyperfocal Distance and Zone Focusing

Focus at the hyperfocal distance and everything from half that distance to infinity is acceptably sharp, which is how landscape photographers get the foreground rock and the mountains in one frame. Once the subject distance reaches the hyperfocal distance the far limit becomes infinity and the calculator says so. Street photographers use the same number for zone focusing: set the lens to a distance and an aperture that cover the range people will pass through, and shoot without waiting for autofocus. A hyperfocal distance chart for full frame:

Focal length f/2.8 f/5.6 f/8 f/11 f/16
16 mm 3.2 m 1.6 m 1.1 m 0.8 m 0.6 m
24 mm 7.2 m 3.6 m 2.5 m 1.8 m 1.3 m
35 mm 15.2 m 7.6 m 5.3 m 3.9 m 2.7 m
50 mm 31 m 15.5 m 10.9 m 7.9 m 5.5 m
85 mm 89.5 m 44.8 m 31.4 m 22.9 m 15.7 m

Sensor Size and the Circle of Confusion

Depth of field depends on how much blur still looks sharp, the circle of confusion. The calculator works it out from the sensor you pick: the sensor diagonal divided by 1500, the common convention for a print viewed at a normal distance. That gives 0.029 mm for full frame, 0.019 mm for APS-C and 0.014 mm for Micro Four Thirds. Many printed tables round full frame to 0.03 mm; to match one, open Circle of confusion under the inputs and type the value, or use a smaller one if you crop hard or print large.

The sensor matters because a smaller sensor needs a shorter lens for the same framing. At 2 m and f/1.8, a 50 mm on full frame keeps 16 cm sharp, a 33 mm on APS-C with the same view keeps 25 cm and a 25 mm on Micro Four Thirds keeps 33 cm. To find the lens that frames the same on another sensor, use the crop factor calculator; to see the sensors side by side to scale, the camera sensor size comparison. This page calculates, it does not simulate: to see a shallow depth of field on a photo you have already taken, the bokeh effect works as a simple depth of field simulator.

Depth of Field Calculation: the Formulas

The calculator uses the thin-lens formulas found in depth of field tables and lens manuals, with f the focal length, N the f-number, c the circle of confusion and s the subject distance:

Distances are measured from the lens. The camera's focus mark on the body sits a few centimetres behind it, which only matters for close-up and macro work, where depth of field shrinks to millimetres: a 100 mm macro lens at f/2.8 focused at 30 cm keeps about 1 mm sharp.

Frequently Asked Questions About Depth of Field

What is depth of field?

Depth of field, sometimes called depth of view, is the distance between the nearest and the farthest points in a scene that look acceptably sharp in the photo. Only one distance is ever in perfect focus; in front of and behind it the blur grows gradually, and depth of field is the range where it stays too small to notice.

How do I get a shallow depth of field?

Open the aperture to a smaller f-number, get closer to the subject, or use a longer lens from the same spot. A longer lens and stepping back to keep the same framing changes surprisingly little: at the same subject size in the frame, depth of field depends mostly on the f-number, and a larger sensor gives less of it at the same f-number.

Why is there more depth of field behind the subject than in front?

Because blur grows more slowly with distance behind the focus point. Close up the split is nearly half and half, at a third of the hyperfocal distance it is the familiar one third in front and two thirds behind, and at the hyperfocal distance the part behind stretches to infinity. The calculator shows the exact split under the diagram.

Which circle of confusion should I use?

The default, the sensor diagonal divided by 1500, suits prints and screens seen whole. If you check photos at 100% on a high resolution camera, a value about half as large gives a stricter answer, which is what the override in the calculator is for.

Is anything sent to a server?

No. The calculator is a few lines of arithmetic that run in your browser, and your lens and camera settings never leave the page.