What is depth of field?
Depth of field (DoF) is the range of distances in a scene that appear acceptably sharp in a photograph. Only one exact plane is in perfect focus, but objects somewhat nearer and farther still look sharp because their blur stays below a threshold called the circle of confusion. This calculator uses pure geometric optics, so it applies to any camera anywhere — no country-specific assumptions.
How to use this calculator
Enter four values: the lens focal length in millimeters, the f-number (aperture, e.g. 2.8 for f/2.8), the distance to subject in meters, and the circle of confusion in millimeters. Use 0.03 mm for full-frame 35mm sensors and roughly 0.02 mm for APS-C. The tool returns the front and back depth of field (measured from the subject), the total depth of field, the near and far focus limits, and the hyperfocal distance.
The formula explained
First the hyperfocal distance is computed as $$H = \frac{f^{2}}{N \cdot c} + f.$$ The near focus limit is $$D_{near} = \frac{s\,(H - f)}{H + s - 2f}$$ and the far limit is $$D_{far} = \frac{s\,(H - f)}{H - s},$$ with all lengths in mm (subject distance is converted from meters by multiplying by 1000). When the subject distance reaches or exceeds the hyperfocal distance, the far limit becomes infinity and depth of field extends forever.
Worked example
For a 50 mm lens at f/2.8, focused at 10 m (\(s = 10000\) mm) with \(c = 0.03\) mm: $$H = \frac{2500}{0.084} + 50 = 29811.90 \text{ mm}.$$ $$D_{near} = \frac{10000 \times 29761.90}{39711.90} = 7494.46 \text{ mm}$$ and $$D_{far} = \frac{10000 \times 29761.90}{19811.90} = 15022.74 \text{ mm}.$$ So front DoF = 2505.54 mm (~2.51 m), back DoF = 5022.74 mm (~5.02 m) and total DoF = 7528.28 mm (~7.53 m).
FAQ
Why is back depth of field larger than front? For typical subject distances the in-focus zone extends roughly twice as far behind the subject as in front, because the optics are not symmetric around the focus plane.
What does "infinity" mean in the result? When you focus at or beyond the hyperfocal distance, everything from the near limit out to infinity is sharp, so the far limit and total DoF are infinite.
How do I get more depth of field? Use a smaller aperture (higher f-number), a shorter focal length, or focus farther away.