optics calculators

Depth of Field Calculator

Calculate the depth of field, hyperfocal distance, and sharp focus range for any camera setup. Use this when planning shots where controlling foreground-to-background sharpness is critical.

About this calculator

Depth of field (DoF) describes the range of distances in a scene that appear acceptably sharp in a photograph. It depends on four key factors: focal length, aperture (f-stop), focus distance, and the sensor's circle of confusion (derived from sensor format). The formula used here is DoF = (2 × aperture × sensorFormat × focusDistance²) / focalLength². A wider aperture (lower f-number) produces a shallower DoF, isolating subjects from backgrounds. A longer focal length also compresses and narrows the DoF. Conversely, stopping down to f/11 or f/16 and using a shorter focal length maximizes depth of field — essential for landscape and architectural photography. Understanding DoF allows photographers to make intentional creative and technical choices about what appears sharp versus blurred in the final image.

How to use

Suppose you're shooting with a 50 mm lens at f/2.8, focused at 3 m, on a full-frame sensor (sensorFormat = 0.029 mm). Plug into the formula: DoF = (2 × 2.8 × 0.029 × 3²) / 50² = (2 × 2.8 × 0.029 × 9) / 2500 = 1.4616 / 2500 ≈ 0.00058 m, or about 0.58 mm. This very shallow depth of field explains why portrait lenses at wide apertures produce such pronounced background blur. Increasing the f-stop to f/11 or focusing farther away would dramatically extend the sharp zone.

Frequently asked questions

How does aperture affect depth of field in photography?

Aperture is one of the most powerful controls over depth of field. A wide aperture (e.g., f/1.8) lets in more light but restricts the sharp zone to a very narrow band, creating the blurred bokeh look popular in portrait photography. A narrow aperture (e.g., f/16) keeps a much larger range of the scene in focus, which is why landscape photographers often stop down. The relationship is direct: doubling the f-number roughly doubles the depth of field, all else being equal.

What is hyperfocal distance and why does it matter for landscape photography?

Hyperfocal distance is the closest focus distance at which objects at infinity still appear acceptably sharp. When you focus at the hyperfocal distance, everything from half that distance to infinity is in focus — maximizing the sharp zone in a single shot. It's especially useful for landscape, street, and documentary photography where you want everything from the foreground to the horizon sharp. You can calculate it using H = focalLength² / (aperture × circleOfConfusion). Knowing your hyperfocal distance lets you pre-focus your camera without checking the viewfinder for every shot.

How does sensor size change the depth of field calculation?

Sensor size affects depth of field through the circle of confusion (CoC), which is the maximum blur spot still perceived as a sharp point by the human eye. Larger sensors have a larger CoC, which can produce a shallower DoF at equivalent settings compared to smaller sensors. However, to frame the same scene with a smaller sensor, you typically use a shorter focal length, which partially offsets this. The sensorFormat value in this calculator encodes the CoC so the formula correctly accounts for the crop factor of your specific camera system.