Depth of Field Calculator: How to Use It
- Near limit
- m
- Result
- Far limit
- m
- Result
- Focal length
- 50 mm
- You entered
A camera depth of field calculator works out how much of your scene appears acceptably sharp in the final photo. You enter your focal length, aperture, and focus distance, and it returns the near limit, far limit, and total depth of field in your chosen units. This page explains the formula behind the numbers and how to apply it to real shooting situations.
Formula
The depth of field (DOF) is the distance between the nearest and farthest points that appear acceptably sharp. The standard formula for total DOF is:
DOF = (2 × d² × a × c) / (f² − (a × c)²)
Where:
- d = focus distance (in meters or feet, but must match the units of f and c)
- a = aperture f-number (e.g., 2.8, 4, 8)
- c = circle of confusion (mm, typically 0.03 for full-frame, 0.02 for APS-C)
- f = focal length (mm)
The near and far limits are calculated separately:
Near limit = (d × f²) / (f² + a × c × d)
Far limit = (d × f²) / (f² − a × c × d)
If the denominator of the far limit is zero or negative, the far limit is at infinity, and the DOF is effectively infinite from the near limit onward.
Worked Example
Using the default values from the calculator: focal length 50 mm, aperture f/2.8, focus distance 5 m, circle of confusion 0.03 mm.
- Calculate the denominator for far limit: f² − a × c × d = 50² − 2.8 × 0.03 × 5 = 2500 − 0.42 = 2499.58
- Near limit = (5 × 2500) / (2500 + 2.8 × 0.03 × 5) = 12500 / (2500 + 0.42) = 12500 / 2500.42 ≈ 4.999 m
- Far limit = 12500 / 2499.58 ≈ 5.001 m
- Total DOF = far − near = 5.001 − 4.999 ≈ 0.002 m (2 mm)
The calculator shows 0.00 m for the total DOF, which rounds to 0.00 m. At f/2.8 and 5 m with a 50 mm lens, the sharp zone is only about 2 mm deep – a classic shallow depth of field.
What the Circle of Confusion Means
The circle of confusion (CoC) is the maximum blur spot that still looks like a point when the image is viewed at a standard size and distance. It is not a physical property of your lens; it is a viewing standard. For a full-frame sensor, 0.03 mm is the traditional value. For APS-C, use about 0.02 mm. For Micro Four Thirds, about 0.015 mm. If you plan to make very large prints or crop heavily, use a smaller CoC (e.g., 0.02 for full-frame) to get a more conservative estimate.
How to Choose the Right CoC for Your Camera
Most calculators let you change the circle of confusion, but many people leave it at the default and get wrong results for their sensor size. Here is a quick guide:
- Full-frame (36×24 mm): 0.030 mm
- APS-C (Canon, 22.3×14.9 mm): 0.019 mm
- APS-C (Nikon/Sony, 23.5×15.6 mm): 0.020 mm
- Micro Four Thirds (17.3×13 mm): 0.015 mm
- Medium format (44×33 mm): 0.040 mm
These are approximate. If you are unsure, look up your camera’s sensor dimensions and divide by 1500 to get a common CoC value. For example, a full-frame sensor width of 36 mm divided by 1500 gives 0.024 mm, which is more conservative than 0.03.
Common Mistakes and Misconceptions
One frequent mistake is mixing units. If you enter focal length in millimeters and focus distance in feet, the formula will give nonsense. Convert everything to the same unit first (e.g., feet to millimeters by multiplying by 304.8). Another error is assuming that depth of field is split evenly in front of and behind the focus point. In reality, the far limit extends about twice as far as the near limit at typical distances, and at close distances the split becomes nearly 50/50.
A common misconception is that a wider lens always gives more depth of field at the same aperture. That is true if you keep the same focus distance, but if you move closer to fill the frame with the same subject, the depth of field becomes roughly the same for any focal length. The real advantage of a wide lens is that you can get the same framing from closer, which increases DOF.
Also, the calculator assumes a perfect lens with no diffraction. At very small apertures (like f/16 or f/22), diffraction softens the entire image, so the “acceptably sharp� zone may be less than the formula predicts. The formula is a geometric approximation, not a physical law.
When to Use a Depth of Field Calculator
Use it when you need to know whether a subject will be fully sharp, such as:
- Portrait photography: to ensure both eyes are in focus, or to blur the background.
- Landscape photography: to find the hyperfocal distance so everything from near to far is sharp.
- Macro photography: where DOF is often only a few millimeters.
- Street photography: to pre-focus at a distance and know the sharp zone.
For hyperfocal distance, set the focus distance to the hyperfocal distance value, and the far limit will be infinity. The near limit will be half the hyperfocal distance. Many calculators have a separate hyperfocal mode, but you can also find it by trial: adjust the focus distance until the far limit shows “infinity.�
Limits of the Formula
The formula assumes a simple thin lens model. Real lenses have aberrations, field curvature, and focus breathing, which change the actual DOF slightly. It also assumes you view the image at a standard size (8×10 inches from about 12 inches away). If you view on a phone screen, the DOF appears larger; if you pixel-peep at 100% on a monitor, it appears smaller. The calculator gives a good estimate, but the final judgment should be based on your output size and viewing distance.
Frequently Asked Questions
What is the best circle of confusion for my camera? For full-frame use 0.030 mm, for APS-C use 0.020 mm, for Micro Four Thirds use 0.015 mm. If you print large or crop heavily, use a smaller value to be safe.
Does sensor size affect depth of field? Yes, but only because you change focal length or distance to get the same framing. A smaller sensor with the same lens and distance gives more DOF, but if you use a shorter lens to match the field of view, the DOF is similar.
What is hyperfocal distance? It is the focus distance that gives the maximum DOF, with the far limit at infinity. Everything from half the hyperfocal distance to infinity appears acceptably sharp.
Why does my calculator show “infinity� for far limit? When the denominator of the far limit formula is zero or negative, the far limit is mathematically infinite. This happens when you focus at or beyond the hyperfocal distance.
Can I use this calculator for a smartphone camera? Yes, but you need to know the actual focal length (often 4–6 mm) and the sensor size to estimate CoC. Many phone cameras have fixed apertures and wide-angle lenses, so the DOF is usually very large.
Related
Formula used
in fl | Focal length | mm | 50 | 0 in a | Aperture (f-number) | - | 2.8 | 0 in d | Focus distance | m | 5 | 0 in coc | Circle of confusion | mm | 0.03 | 0 out dof | Depth of field | m | (2 * d^2 * a * coc) / (fl^2 - (a * coc)^2) | 2 out near | Near limit | m | (d * fl^2) / (fl^2 + a * coc * d) | 2 out far | Far limit | m | (d * fl^2) / (fl^2 - a * coc * d) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.