Focus

Depth of Field Calculator

See exactly how much of your scene will be sharp. Enter your sensor, focal length, aperture and focus distance to get near and far limits, total depth of field and hyperfocal distance.

Camera and lens

Total depth of field

—

Enter your settings

Near limit
—
Far limit
—
In front of subject
—
Behind subject
—
Hyperfocal distance
—

What is depth of field?

Depth of field (DOF) is the distance between the nearest and farthest points in a photo that look acceptably sharp. Only one plane is ever in perfect focus. In front of and behind it, sharpness falls off gradually, and DOF is the zone where that falloff is too small to notice at a normal viewing size.

Four things control it:

  • Aperture: a wider aperture (smaller f-number, like f/1.8) gives shallower depth of field.
  • Focus distance: the closer you focus, the shallower it gets.
  • Focal length: at the same distance, longer lenses give shallower depth of field.
  • Sensor size, through the circle of confusion: for the same framing and f-number, larger sensors give shallower depth of field.

Depth of field formulas

Hyperfocal H = f² ÷ (N × c) + f Near limit = s × (H − f) ÷ (H + s − 2f) Far limit = s × (H − f) ÷ (H − s) (infinity when s ≥ H) Total DOF = far − near

Where f is focal length, N the f-number, c the circle of confusion and s the focus distance, all in the same unit (millimeters here).

Worked example: 50mm at f/8

A full-frame camera with a 50mm lens at f/8, focused at 3 meters, with a 0.030 mm circle of confusion:

H = 50² ÷ (8 × 0.03) + 50 = 10,467 mm (10.47 m) Near = 3000 × 10,417 ÷ (10,467 + 3000 − 100) = 2.34 m Far = 3000 × 10,417 ÷ (10,467 − 3000) = 4.19 m DOF = 4.19 − 2.34 = 1.85 m

About 0.66 m of the sharp zone falls in front of the subject and 1.19 m behind. Open up to f/2.8 and the total shrinks to about 0.60 m. That's ideal for a portrait with a softly blurred background.

Hyperfocal distance for landscapes

Focus at the hyperfocal distance and everything from half that distance to infinity will be acceptably sharp, the maximum depth of field possible at that aperture. For a 24mm lens at f/11 on full frame:

H = 24² ÷ (11 × 0.03) + 24 = 1,769 mm ≈ 1.77 m Sharp from ≈ 0.88 m to infinity

In practice, many landscape photographers focus slightly beyond the hyperfocal distance. A small focusing error then costs a little foreground sharpness instead of softening the horizon.

The circle of confusion, and why your results may differ

The circle of confusion is the largest blur spot that still looks like a point to the eye. The standard values above assume an 8 × 10 inch print viewed from about 25 cm by someone with normal vision. They're the same conventions printed on lens distance scales.

If you view images large on a high-resolution screen or crop heavily, use a smaller value (for example half the default) for a stricter standard. DOF calculators also treat sharpness as a hard cutoff, while real lenses fade gradually, so treat the limits as a guide rather than a sharp line.

Myth check: the "one-third in front, two-thirds behind" rule is only roughly true at moderate distances. Up close the split approaches 50/50, and near the hyperfocal distance almost all of the depth is behind the subject. The status line shows the actual split.

Frequently asked questions

What aperture gives the most depth of field?

Smaller apertures (higher f-numbers like f/11 or f/16) give more depth of field. Beyond about f/11–f/16 on full frame, diffraction starts to soften the whole image, so the sharpest landscape results usually come from f/8–f/11 focused near the hyperfocal distance.

Does sensor size affect depth of field?

At the same framing and f-number, yes: a larger sensor gives shallower depth of field. At the same focal length, f-number and distance, a smaller sensor actually has less DOF because its image is enlarged more, which is why it uses a smaller circle of confusion.

What is hyperfocal distance?

The focus distance that gives the greatest depth of field at a given aperture. Focus there, and everything from half that distance to infinity is acceptably sharp.

Which circle of confusion should I use?

Use the default for your format for general work. For critical sharpness on large prints or 4K/8K displays, use roughly half the default value.

Last reviewed October 11, 2026. Calculations are estimates. Sun times can vary slightly with terrain, elevation and atmospheric conditions. Found a mistake? Tell us.