What it's for
Depth of field (DoF) is the range of distances, in front of and behind the focused point, that appears acceptably sharp in a photo. This calculator gives you the near limit, far limit and hyperfocal distance from the lens's focal length, the aperture (f-number) and the camera's sensor format.
Formulas used
We use the classic optics formulas built on the circle of confusion (CoC) — the largest blur spot the human eye still perceives as a sharp point at typical viewing size. Hyperfocal distance: H = f²/(N·c) + f. Near limit: Dn = (H·s)/(H+(s−f)). Far limit: Df = (H·s)/(H−(s−f)), or infinity when the subject distance (s) is at or beyond the hyperfocal distance (H). Here f is the focal length, N is the f-number, c is the sensor's circle of confusion and s is the subject distance — all converted internally to the same unit (mm).
Where the circle of confusion per sensor comes from
Each sensor format uses a different CoC value, because smaller sensors enlarge the final image more for the same print/screen size, making blur more noticeable. The approximate values used here (in mm) are: Full Frame 0.030; APS-C Canon 0.019; APS-C Nikon/Sony 0.020; Micro 4/3 0.015; 1-inch 0.011; smartphone 0.005 — standard values widely used by DoF calculators and lens manufacturers.
Worked example
A 50mm lens at f/8 focused on a subject 5 meters away on a full-frame camera gives a hyperfocal distance of about 10.5 meters, with sharp focus running from roughly 3.4m to 9.5m — a depth of field of about 6.1 meters.
Limitations
The result is an estimate based on standard optical conventions, not a measurement of your specific lens (real lenses vary somewhat). "Sharp" also depends on display/print size and viewing distance — the CoC values used assume a typical enlargement and viewing setup.
Frequently asked questions
What is the circle of confusion (CoC)?
It's the largest blur spot the human eye still perceives as a sharp point at a typical viewing size. Smaller sensors use a smaller CoC because the image is enlarged more to reach the same final size.
What does "infinity" mean for the far limit?
It means that with this combination of focal length, aperture and focus distance, everything from the near limit out to the horizon appears sharp — you've reached or passed the hyperfocal distance.
Why does depth of field change so much with aperture?
Because the f-number sits directly in the denominator of the hyperfocal formula — smaller apertures (f/16, f/22) greatly increase depth of field, while wider apertures (f/1.4, f/2.8) sharply reduce it.
Are the values exact for any lens?
They're a good estimate based on standard optics, but real lenses can vary slightly due to specific optical design, focus breathing and other factors the classic formula doesn't capture.