Depth of Field Calculator
Find near limit, far limit, total depth of field, and hyperfocal distance from focal length, aperture, and focus distance.
What it does
Depth of field is the range of subject distances that appear sharp in a photograph. Only one plane is in exact focus, but human vision tolerates a small amount of blur. The depth of field calculation turns that tolerance into a near limit and a far limit around the focus distance.
Three settings control the result. Aperture sets how much the light cone converges. Focal length sets the scale of the image. Focus distance sets where the sharp plane sits. Open the aperture, lengthen the lens, or move closer, and the sharp zone narrows. Stop down, shorten the lens, or step back, and it grows.
The tolerance is called the circle of confusion. A common value for full frame is 0.03 mm, with smaller values for smaller sensors. That is a convention, not a law. It assumes a certain print size and viewing distance, so a large print viewed closely may reveal blur outside the calculated zone.
This calculator uses the exact lens formulas rather than a small-angle shortcut. It reports the total depth, the near limit, the far limit, and the hyperfocal distance. When the focus distance is at or beyond the hyperfocal distance, the far limit becomes infinite and the total depth is unlimited.
Use the result as a planning tool. Autofocus systems, lens aberrations, diffraction, and motion blur all affect what looks sharp. The formula tells you what the optics allow, not what the final image will look like at every size.
How to use
- Choose metric or imperial for the focus distance.
- Select the sensor size so the circle of confusion matches the format.
- Enter the lens focal length in millimeters.
- Enter the f-number used for the shot.
- Enter the distance you will focus on.
- Read the total depth and the near and far limits before you shoot.
Formula
- f
- Focal length in millimeters.
- N
- Aperture f-number.
- c
- Circle of confusion in millimeters for the sensor.
- s
- Focus distance in millimeters.
- H
- Hyperfocal distance in millimeters.
The circle of confusion values used here are 0.03 mm for full frame, 0.02 mm for APS-C, 0.015 mm for Micro Four Thirds, and 0.011 mm for a 1 inch sensor. Other conventions exist, so a different calculator may show a slightly different depth. Keep focal length and distance in the same unit family before converting the result.
Worked example
Example: 50 mm at f/8 focused at 5 m
Metric defaults: full frame sensor, 50 mm focal length, f/8, 5 m focus distance. The imperial mirror is 16.4 ft.
- Hyperfocal: H = 50^2 / (8 x 0.03) + 50 = 2500 / 0.24 + 50 = 10,466.67 mm.
- Near limit: 5,000 x (10,466.67 - 50) / (10,466.67 + 5,000 - 100) = 3,389.4 mm.
- Far limit: 5,000 x (10,416.67) / (10,466.67 - 5,000) = 9,527.4 mm.
- Total depth: 9,527.4 - 3,389.4 = 6,138.0 mm, or 6.14 m.
- The hyperfocal distance is 10,466.67 mm, or 10.47 m.
- The tool shows 6.14 m total, near 3.39 m, far 9.53 m, and hyperfocal 10.47 m.
- In imperial mode the same setup at 16.4 ft shows 20.12 ft total, near 11.12 ft, far 31.24 ft.
Reference table
| Aperture | Near limit | Far limit | Total depth |
|---|---|---|---|
| f/1.8 | 4.52 m | 5.6 m | 1.08 m |
| f/2.8 | 4.29 m | 6 m | 1.71 m |
| f/4 | 4.04 m | 6.56 m | 2.52 m |
| f/8 | 3.39 m | 9.53 m | 6.14 m |
| f/16 | 2.56 m | 100.81 m | 98.24 m |
Limits
- The result depends on the chosen circle of confusion. A print viewed closely or a crop viewed large may show blur outside the calculated zone.
- Diffraction at small apertures can soften the whole image even though the formula predicts a large depth of field.
- Lens focus breathing and floating elements can shift the effective focal length, especially at close range.
- The formula assumes a flat subject plane and a perfect lens. Field curvature and aberrations change the real sharp zone.
Common mistakes
- Using a full frame circle of confusion on a smaller sensor, which overstates the depth.
- Measuring focus distance from the front of the lens instead of the sensor plane.
- Assuming the hyperfocal distance makes everything sharp from zero to infinity. The near limit is about half the hyperfocal distance, not zero.
- Forgetting that cropping an image and enlarging it reduces the apparent depth of field.
- Stopping down past the diffraction limit and losing sharpness while chasing more depth.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is the depth of field for a 50 mm lens at f/16 on full frame focused at 5 m?
98.24 m total, with a near limit of 2.56 m and a far limit of 100.81 m.
A 35 mm lens at f/4 on full frame focuses at 3 m. What are the limits?
1.9 m total, near 2.32 m, far 4.23 m, hyperfocal 10.24 m.
An 85 mm lens at f/2 on full frame focuses at 10 m. What is the sharp zone?
1.66 m total, near 9.24 m, far 10.9 m, hyperfocal 120.5 m.
Questions
What is the hyperfocal distance?
It is the focus distance at which the far limit reaches infinity. Focusing there gives the largest depth of field for a given focal length, aperture, and sensor.
Why does a smaller sensor have more depth of field?
At the same angle of view, a smaller sensor uses a shorter focal length, which increases depth. The smaller circle of confusion partly offsets that, so the comparison depends on how you match the shots.
Is depth of field the same as focus?
No. Focus is the plane of exact sharpness. Depth of field is the surrounding zone that looks acceptably sharp.
Does the calculator work for macro photography?
The standard formulas become less accurate at very close distances because lens breathing and pupil magnification matter. Use the result as an estimate for macro work.
Why is the far limit infinity in some results?
When the focus distance is at or beyond the hyperfocal distance, the far limit extends to infinity and the total depth is unlimited.
Which circle of confusion should I use?
Use the value that matches your sensor and how you will display the image. The values here are common defaults for full frame, APS-C, Micro Four Thirds, and 1 inch sensors.
Sources
- Carnegie Mellon University, ViewCam depth of field notes
- MIT CSAIL, Lens and image formation fundamentals