Depth of Field Calculator
Enter your focal length, aperture, focus distance, and sensor size to calculate the total depth of field and the near/far focus limits.
🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.
Focus range
How Depth of Field Calculator works
- Choose your sensor format — this sets the circle of confusion (CoC) value used in the calculation.
- Enter your lens's focal length, the aperture (f-number) you're shooting at, and the distance you're focused on.
- The tool computes the hyperfocal distance, then uses it to find the near and far edges of acceptably sharp focus.
- The visual bar shows where that in-focus range falls relative to your focus point, updating instantly as you adjust any value.
The formulas
Hyperfocal distance, in the same units as focal length:
H = f² / (N × c) + f
Near and far focus limits, given subject distance s:
Near = s(H − f) / (H + s − 2f) Far = s(H − f) / (H − s)
where f is focal length, N is the f-number, and c is the circle of confusion for your sensor — these are the standard optical formulas used across photography depth-of-field references and calculators.
FAQ
What is "circle of confusion" and why does sensor size change it?
The circle of confusion (CoC) is the largest blur spot the eye still perceives as a sharp point, and it scales with sensor size — a smaller sensor (like APS-C or Micro Four Thirds) is enlarged more to reach the same print size, so its acceptable blur circle is proportionally smaller. That single number is what makes the same focal length and aperture produce a different depth of field on different camera formats.
What is the hyperfocal distance?
It's the focus distance beyond which everything up to infinity stays acceptably sharp. Focusing exactly at the hyperfocal distance gives you the maximum possible depth of field for a given focal length and aperture — from half the hyperfocal distance all the way to infinity.
Why does the far focus limit sometimes show ∞?
When your focus distance is at or beyond the hyperfocal distance, the far edge of acceptable sharpness mathematically extends past infinity — in practice, this means everything from the near limit to the horizon is in focus, so the calculator reports it as ∞ rather than a nonsensical negative distance.
How we compare
| Feature | Online Tool Store | A printed DoF scale on the lens | A dedicated DoF calculator app |
|---|---|---|---|
| No file upload — runs in your browser | ✓ | N/A | ✗ |
| No sign-up required | ✓ | ✓ | ✗ |
| Free, no watermark | ✓ | ✓ | ✗ |
Most modern lenses don't even print a distance scale anymore, and a dedicated app means a download and an account you don't need for one calculation. This runs the same hyperfocal-distance math directly in your browser.