What this Depth of Field Calculator does
The Depth of Field Calculator estimates how much of a photograph appears acceptably sharp in front of and behind the point where the lens is focused. It uses focal length, aperture, subject distance, and circle of confusion to calculate a total depth of field in millimeters. The model is based on a thin-lens hyperfocal-distance approximation.
Depth of field is a range, not a perfectly sharp boundary. In a photograph, details gradually look less defined as they move away from the focus plane. The calculator gives a practical estimate for comparing camera settings and planning a shot. Its result is the total distance between the calculated near and far focus limits. It does not measure image sharpness or account for every camera and viewing condition.
The calculation treats the subject distance as the distance from the lens to the subject, in millimeters. It assumes a conventional circle of confusion value supplied by the user. That value represents the largest blur circle considered acceptably sharp for the intended viewing conditions.
How to use the Depth of Field Calculator
Enter the four values that describe the shot you want to estimate. Use the same units and assumptions when comparing results so that the comparison is meaningful.
- Focal length is the lens focal length in millimeters, such as 50 mm.
- Aperture is the f-number, such as f/2.8. Enter 2.8, not 1/2.8.
- Subject distance is the approximate distance from the lens to the subject in millimeters.
- Circle of confusion is the acceptable blur-circle diameter in millimeters. Choose a value suited to your camera format and viewing assumptions.
For example, enter 50 mm, f/2.8, a subject distance of 2,000 mm, and a circle of confusion of 0.03 mm. The calculator returns an estimated total depth of field of about 1,101.20 mm. This is a model result, not a promise that every detail across that distance will appear equally sharp.
How the Depth of Field Calculator formula works
The formula first calculates hyperfocal distance, represented by H. In this model, H equals the square of focal length divided by aperture times circle of confusion, plus focal length. All distances in the formula use millimeters.
It then calculates the far focus limit as H multiplied by subject distance, divided by H minus the difference between subject distance and focal length. The near focus limit uses the same numerator, with H plus that difference in the denominator. The calculator subtracts the near limit from the far limit to get the total depth of field.
For the example inputs, H is approximately 29,811.90 mm. The near limit is approximately 1,875.99 mm and the far limit is approximately 2,977.19 mm. Subtracting the near limit from the far limit gives a depth of field of about 1,101.20 mm. Small differences can arise if intermediate values are rounded.
The result changes in expected ways within this model. A smaller aperture opening, represented by a higher f-number, usually increases the estimated depth of field. Moving the focus distance farther away also tends to increase the range. Longer focal lengths generally reduce depth of field when the other inputs and framing assumptions remain comparable.
Use cases for the Depth of Field Calculator
Photographers can use the estimate to compare possible settings before taking a picture. A close-up product image may need enough depth of field to show important details across the subject. A portrait may use a shallower range to separate the subject from the background. A landscape photograph may call for a broader zone of acceptable sharpness.
The tool can also support planning for tabletop photography, food images, and still life. For a small object, a slight change in camera distance or aperture can noticeably change which parts appear sharp. Checking a few combinations helps reveal the trade-offs before setting up lights or arranging a scene.
Use the calculator to compare settings while holding the other inputs constant. For instance, compare two aperture values at the same focal length, distance, and circle of confusion. This isolates the estimated effect of aperture in the model. Then test a distance change separately. A short list of comparisons is often easier to interpret than changing every setting at once.
Other factors to consider when calculating depth of field
The circle of confusion is an important assumption. It depends on factors such as sensor or film format, enlargement, viewing distance, and the level of detail a viewer expects. A value that works for one output size may not describe acceptable sharpness for a large print viewed closely. Use a circle of confusion that matches the assumptions behind your intended use.
Lens focus distance is also difficult to measure precisely. The formula uses distance from the lens, while a photographer may estimate distance from the camera body or sensor plane. At ordinary distances the difference may be modest, but close-up work can make measurement and lens behavior more significant. The thin-lens approximation also simplifies real optical systems.
Motion, diffraction, focus errors, lens aberrations, and camera shake can affect apparent detail without changing this calculated range. At small apertures, diffraction can reduce fine detail across the frame. A tripod, careful focusing, and reviewing a test image can help assess the actual result. Treat the estimate as a planning aid and verify critical focus in the captured image.
Depth of Field Calculator FAQ
Does depth of field mean everything in the range is perfectly sharp?
No. The near and far limits mark a chosen threshold for acceptable sharpness. Detail changes gradually with distance from the focus plane, and the circle of confusion sets part of that threshold.
Why does the circle of confusion affect the result?
It defines how large a blur circle may become before it is judged unacceptably soft. A larger accepted circle generally produces a larger calculated depth of field. The appropriate value depends on format and viewing conditions.
Should I enter the aperture as f/2.8 or 2.8?
Enter the numeric f-number, such as 2.8. The calculator uses that value directly in its formula.
Why can my photograph look different from the estimate?
The estimate simplifies the lens and viewing conditions. Focus accuracy, subject movement, diffraction, lens design, output size, and viewing distance can all affect the photograph. Use the result for comparison and inspect the image for confirmation.
Can I compare different camera formats?
You can compare them if you choose an appropriate circle of confusion for each format and keep the other assumptions clear. Using the same circle of confusion for every format may not represent equivalent viewing conditions.