What this Depth of Field Calculator does
The Depth of Field Calculator estimates the total distance in front of and behind a focused subject that appears acceptably sharp in a photograph. It uses focal length, aperture, subject distance, and a circle of confusion value to estimate that zone. The result is expressed in meters and represents the combined near-to-far span.
Depth of field is not a hard physical boundary where everything suddenly changes from sharp to blurred. Sharpness falls gradually away from the plane of focus. The calculation applies an optical convention for deciding when blur is small enough to count as acceptable. That convention is represented by the circle of confusion. A smaller value uses a stricter sharpness criterion and generally predicts a narrower depth-of-field zone.
The calculator uses a thin-lens approximation and assumes the supplied distance is measured from the camera's optical reference point. Actual lenses and cameras introduce details that this compact model does not capture, so treat the result as a planning estimate rather than a measurement of every pixel in the final image.
How to use the Depth of Field Calculator
Enter the lens focal length in millimeters, the selected aperture as an f-number, and the distance to the subject in meters. Add a circle of confusion value in millimeters that suits the camera format and the viewing assumptions you want to use. The output is the estimated total depth of field in meters.
- Focal length: Use the physical focal length shown on the lens. For a zoom lens, use the focal length set for the planned photograph.
- Aperture: Enter the f-number, such as 2.8 or 8. A larger f-number means a smaller aperture opening.
- Subject distance: Measure from the camera's lens reference point to the subject, and convert that distance to meters.
- Circle of confusion: Choose a value in millimeters consistent with your sensor format and intended viewing size.
For a worked example, use a 50 mm lens at f/2.8, focused at 3 m, with a 0.03 mm circle of confusion. The formula converts the subject distance to 3000 mm. The hyperfocal distance term is (50² / (2.8 × 0.03)) + 50, or about 29,812 mm. The near focus distance is approximately 2,737 mm and the far focus distance is about 3,321 mm. Subtracting near from far gives roughly 584 mm, or 0.58 m of total depth of field. The displayed result rounds this estimate to two decimal places.
How the Depth of Field Calculator formula works
The calculation first derives the hyperfocal distance from focal length, f-number, and circle of confusion. In simplified form, hyperfocal distance is focal length squared divided by the product of aperture number and circle of confusion, with focal length added. All three of those optical measurements are handled in millimeters.
It then estimates the near and far focus limits using the hyperfocal distance and subject distance. The near limit lies closer to the camera than the focused subject, while the far limit lies beyond it. Total depth of field is the far limit minus the near limit. The formula combines these relationships into one expression, then converts the millimeter span into meters for the result.
Units matter. Focal length and circle of confusion are entered in millimeters, while subject distance is entered in meters and converted to millimeters inside the formula. Mixing units or entering centimeters as meters can produce a result that is far from useful. The chosen input limits also keep the formula's distance denominators above zero across valid combinations.
Use cases for the Depth of Field Calculator
This estimate can help with planning a portrait, close-up, or landscape composition before making exposures. A portrait photographer might compare focusing distances and apertures to see how much of a face or nearby scene could fall within the acceptable-sharpness zone. A macro photographer may find that the estimated zone becomes very narrow at short distances, which can inform a decision to make a test frame or adjust the composition.
For landscape work, the calculation can support a focus-distance decision when foreground detail and distant scenery both matter. It can also help photographers compare two setups, such as a wider aperture at one distance and a smaller aperture at another. Use the same circle of confusion when comparing options so the assumptions remain consistent.
The number is useful as a starting point for a practical workflow:
- Set the planned lens, aperture, and focus distance.
- Calculate the estimated near-to-far range.
- Check important foreground and background details at the intended viewing scale.
- Make a test image and adjust focus, aperture, or framing when needed.
Other factors to consider when calculating depth of field
The circle of confusion depends on sensor format, enlargement, viewing distance, and the sharpness standard being applied. A conventional value can be convenient, but it does not guarantee that a print or screen image will look sharp to every viewer. If your camera maker or a trusted depth-of-field reference specifies a value for your format, use that value consistently.
Lens design, focus breathing, internal focusing, and close-focus behavior can cause real results to differ from a simple thin-lens model. At close distances, especially in macro photography, magnification and pupil magnification can matter. Diffraction also reduces fine detail as the aperture becomes very small. That effect is distinct from depth of field, though both can influence perceived sharpness.
Camera movement, subject movement, focus error, and the resolution of the final output affect the image too. A calculated zone does not ensure that a moving subject will be frozen or that every detail within the zone will be equally crisp. Review a test frame at the size and display conditions that matter for the photograph.
Depth of field calculator FAQ
Does a higher f-number increase depth of field?
Under the assumptions in this model, increasing the f-number generally expands the estimated near-to-far range. A smaller aperture opening changes the optical geometry, although very small apertures can make fine detail softer through diffraction.
Why does the circle of confusion change the result?
It defines the blur size that will still count as acceptably sharp. A smaller circle sets a stricter standard and usually produces a smaller estimated depth-of-field range.
Is the result exact for my camera and lens?
No. It is an approximation based on a thin-lens model and the inputs provided. Lens construction, focus behavior, magnification, and viewing conditions can shift practical results.
Should I measure subject distance from the sensor or lens?
The model treats distance as an approximate camera-to-subject distance from the optical reference point. For precise lens calculations, use the distance convention specified by the optical method you are following, and keep it consistent.
Can I use this for macro photography?
You can use it as a rough planning estimate, but close focusing and high magnification make simplified assumptions less reliable. Make a test exposure and inspect the area of critical detail at the intended output size.