ToolZoneX
Blog

Depth of Field Calculator - Photography DOF Calculator

Calculate near and far depth-of-field boundaries from focal length, aperture, subject distance, and sensor size.

mm

f/

m

Depth of Field

4.29 m6.00 m

Total DOF: 1.71 m
Hyperfocal distance: 29.81 m


How Depth of Field Is Calculated

Depth of field (DOF) is the range of distance in a photo that appears acceptably sharp, controlled by focal length, aperture (f-stop), subject distance, and sensor size. This is a different photography concept from exposure — for balancing brightness via aperture, shutter speed, and ISO, see our Exposure Calculator. This tool focuses specifically on how much of the scene stays in focus.

The calculator first finds the hyperfocal distance — the focus distance beyond which everything up to infinity stays sharp — then uses it to find the near and far limits of acceptable sharpness for your specific subject distance.

Hyperfocal Distance (H) = f² ÷ (N × c) + f
Near Limit = (H × s) ÷ (H + (s − f))
Far Limit = (H × s) ÷ (H − (s − f))

Where f is focal length, N is the f-number, s is subject distance, and c is the circle of confusion — a value that depends on sensor size (smaller sensors use a smaller circle of confusion, which is why smaller sensors generally produce more depth of field at the same aperture).

Example

A 50mm lens at f/2.8, focused on a subject 5m away on a full-frame camera, gives a depth of field of roughly 4.3m to 6.1m — about 1.8m of the scene stays acceptably sharp. The same settings on a Micro Four Thirds camera produce a noticeably deeper zone of sharpness, since smaller sensors need less aperture to achieve the same depth of field.

Common Use Cases

  • Planning how much background blur (bokeh) a portrait shot will have.
  • Making sure a landscape shot keeps foreground and background both in focus.
  • Understanding how switching cameras or lenses changes your usual depth of field.
  • Finding the hyperfocal distance for landscape or street photography.

FAQs

Why does sensor size affect depth of field?

Smaller sensors require a shorter focal length to achieve the same field of view as a larger sensor, and shorter focal lengths naturally produce more depth of field at a given aperture — which is why phone cameras (very small sensors) struggle to produce shallow-depth-of-field background blur compared to full-frame cameras.

What is the circle of confusion?

The circle of confusion is the largest blur spot the human eye still perceives as a sharp point at normal viewing distances. It's a standardized value that scales with sensor size — this calculator uses 0.03mm for full-frame and scales it down proportionally for smaller sensors via their crop factor.

What happens if my subject distance is beyond the hyperfocal distance?

Once your subject distance meets or exceeds the hyperfocal distance, everything from roughly half that distance out to infinity is in acceptable focus — the calculator shows the far limit as infinite (∞) in that case.