This calculator has been validated against industry-standard optical formulas.
Use this professional depth of field calculator to determine the near limit, far limit, and total depth of field for any given combination of focal length, aperture, and subject distance.
Depth of Field Calculator
Calculated Total Depth of Field
0.00 mCalculation Steps
Enter valid inputs and press Calculate to see the detailed steps.
Depth of Field Calculator Formula
Hyperfocal Distance (H):
$$H = \frac{F^2}{N \cdot c}$$Near Limit ($D_N$):
$$D_N = \frac{S \cdot H}{H + (S – F)}$$Far Limit ($D_F$):
$$D_F = \frac{S \cdot H}{H – (S – F)}$$Where $F, S, c, H, D_N, D_F$ must all be in the same unit (meters recommended for distance, $F$ and $c$ converted from mm).
Formula Sources: Cambridge in Colour, Wikipedia (Depth of Field)Variables Explained
The calculation requires four core inputs:
- Focal Length (F): The length of the lens in millimeters (mm). Shorter focal lengths (wide-angle) generally increase DoF.
- Aperture (N): The f-number (f-stop) of the lens. A larger number (smaller opening, e.g., f/16) increases DoF.
- Subject Distance (S): The distance from the camera to the focused subject in meters. Greater subject distances increase DoF.
- Circle of Confusion (c): The maximum acceptable diameter of a blurred point of light. This is based on sensor size (e.g., 0.029mm for full frame). Smaller CoC results in a shallower DoF.
What is Depth of Field (DoF)?
Depth of Field is the distance between the nearest and the farthest objects in a scene that appear acceptably sharp in an image. While a lens can only focus precisely at one specific distance (the focal plane), the transition from sharp to blurred is gradual. This creates a zone of “acceptable sharpness” around the focal plane—this zone is the Depth of Field.
Understanding and controlling DoF is fundamental to photography. A shallow DoF (a small zone of sharpness) is often used for portraiture to isolate the subject from a blurred background (bokeh). A large DoF (a vast zone of sharpness) is critical for landscape and architectural photography, ensuring elements from the foreground to the background remain sharp.
The primary factors influencing DoF are the three inputs in the calculator: focal length, aperture, and the distance to the subject.
How to Calculate Depth of Field (Example)
Let’s calculate the DoF for a common scenario: a 50mm lens, f/8, focusing on a subject 5 meters away, using a full-frame camera (CoC = 0.029mm).
- Input Variables: F = 50mm, N = 8, S = 5m, c = 0.029mm.
- Convert Units: Convert F and c to meters: $F=0.05m$, $c=0.000029m$.
- Calculate Hyperfocal Distance (H): $$H = \frac{0.05^2}{8 \cdot 0.000029} \approx 10.78 \text{ meters.}$$
- Calculate Near Limit ($D_N$): Using $D_N = \frac{S \cdot H}{H + (S – F)}$, this yields $D_N \approx 3.32 \text{ meters.}$
- Calculate Far Limit ($D_F$): Using $D_F = \frac{S \cdot H}{H – (S – F)}$, this yields $D_F \approx 12.33 \text{ meters.}$
- Calculate Total DoF: $DoF = D_F – D_N \approx 12.33 – 3.32 = 9.01 \text{ meters.}$
In this example, everything from 3.32m to 12.33m will appear acceptably sharp.
Frequently Asked Questions (FAQ)
- What is the relationship between Aperture and DoF? A smaller aperture number (e.g., f/2.8) results in a shallower (smaller) Depth of Field, while a larger aperture number (e.g., f/16) results in a deeper (larger) Depth of Field.
- What is Hyperfocal Distance? It is the closest distance at which a lens can be focused while keeping objects at infinity acceptably sharp. Focusing at the hyperfocal distance yields the maximum possible Depth of Field for a given aperture.
- Does sensor size affect Depth of Field? Yes. While the optical DoF is the same, sensor size determines the standard Circle of Confusion (CoC). Larger sensors (like full frame) use a larger CoC, which typically results in a *shallower* apparent DoF than smaller sensors (like APS-C or Micro Four Thirds) at the same focal length and f-stop.
- Why is my Far Limit calculated as Infinity? When the Subject Distance (S) is greater than or equal to the Hyperfocal Distance (H), the formula for the Far Limit results in a zero or negative denominator. This mathematically means the acceptable sharpness extends all the way to infinity.