Depth of Field Calculator
An essential tool for photographers to master focus and image sharpness.
Determines the Circle of Confusion (CoC) for calculating what appears sharp.
The focal length of your lens in millimeters.
A smaller f-number (e.g., f/1.8) gives a shallower DoF; a larger number (e.g., f/16) gives a deeper DoF.
The distance from your camera’s sensor to the subject.
Calculation Results
–
–
–
–
| Description | Distance | Percentage of Total DoF |
|---|---|---|
| In Front of Subject | – | – |
| Behind Subject | – | – |
| Total Depth of Field | – | 100% |
What is a Depth of Field Calculator?
A depth of field calculator is an indispensable tool for photographers that determines the distance range within an image that will appear acceptably sharp. The term “depth of field” (DoF) refers to this zone of sharpness. By inputting key variables like camera sensor size, lens focal length, aperture (f-stop), and subject distance, the calculator computes the near focus limit, far focus limit, and the total DoF. This allows a photographer to precisely control which elements of their scene are in focus and which are blurred, a fundamental technique for creative and technical photography. Using a depth of field calculator helps you move from guessing to knowing, ensuring your artistic vision is perfectly captured.
Whether you’re aiming for a portrait with a beautifully blurred background (shallow DoF) or a sweeping landscape where everything from the foreground to the mountains is tack sharp (deep DoF), this calculator is your ally. For a more in-depth guide on the basics, you can read about the exposure triangle explained, which is a core concept in photography.
Depth of Field Formula and Explanation
The calculations behind a depth of field calculator involve several steps, starting with the Hyperfocal Distance. The formulas are based on principles of optics and geometry. Understanding them can provide a deeper appreciation for how your camera and lens work together.
1. Hyperfocal Distance (H)
This is the closest distance at which a lens can be focused while keeping objects at infinity acceptably sharp. When the lens is focused at this distance, the DoF extends from half of the hyperfocal distance to infinity.
Formula: H = (F² / (N * C)) + F
2. Near and Far Focus Limits
Once the hyperfocal distance is known, we can calculate the nearest and farthest points of acceptable sharpness for a given subject distance.
Near Limit Formula: Dn = (S * (H - F)) / (H + S - (2 * F))
Far Limit Formula: Df = (S * (H - F)) / (H - S)
3. Total Depth of Field (DoF)
The total DoF is simply the difference between the far and near focus limits.
Formula: DoF = Df - Dn
| Variable | Meaning | Unit (in formula) | Typical Range |
|---|---|---|---|
| F | Focal Length | mm | 14mm – 600mm |
| N | Aperture (f-number) | unitless | 1.2 – 32 |
| C | Circle of Confusion | mm | 0.015mm – 0.030mm |
| S | Subject Distance | mm | 0.5m – infinity |
Practical Examples
Here are two common scenarios to illustrate how the depth of field calculator works in practice.
Example 1: Portrait Photography (Shallow DoF)
You want to take a headshot where the person is sharp but the background is completely blurred to remove distractions.
- Inputs:
- Camera Sensor: Full Frame (CoC ≈ 0.029mm)
- Focal Length: 85mm
- Aperture: f/1.8
- Subject Distance: 2 meters
- Results:
- Total Depth of Field: approx. 0.07 meters (or 7 cm)
- This creates a very narrow plane of focus, ensuring only your subject’s face is sharp.
Example 2: Landscape Photography (Deep DoF)
You want to capture a vast landscape where the flowers in the foreground and the mountains in the background are all in focus.
- Inputs:
- Camera Sensor: Full Frame (CoC ≈ 0.029mm)
- Focal Length: 24mm
- Aperture: f/11
- Subject Distance: 3.4 meters (the hyperfocal distance for these settings)
- Results:
- Near Focus Limit: approx. 1.7 meters
- Far Focus Limit: Infinity
- Total Depth of Field: Infinite. By focusing at the hyperfocal distance calculator point, you maximize sharpness throughout the scene.
How to Use This Depth of Field Calculator
- Select Your Camera Sensor: Choose the sensor size that matches your camera. This is crucial as it sets the Circle of Confusion, the basis for all calculations. If you’re unsure, a quick search for your camera model will tell you its sensor size.
- Enter Lens Focal Length: Input the focal length of your lens in millimeters (e.g., 50 for a 50mm prime lens).
- Choose Your Aperture: Select the f-stop you plan to use from the dropdown. Remember, a lower f-number means a wider aperture. Understanding what is aperture is key to controlling DoF.
- Set Subject Distance & Units: Enter how far your subject is from the camera. Make sure to select the correct units (meters or feet) as this will significantly impact the results.
- Interpret the Results: The calculator will instantly show you the Total Depth of Field, the Near and Far focus limits, and the Hyperfocal Distance. Use these numbers to understand what will be sharp in your photo before you even press the shutter.
Key Factors That Affect Depth of Field
Mastering depth of field requires understanding the three primary factors that control it. Our depth of field calculator balances these for you, but knowing them helps you make better creative decisions.
- Aperture (f-stop): This is the most direct control. A wide aperture (small f-number like f/1.8) creates a shallow depth of field, ideal for isolating a subject. A narrow aperture (large f-number like f/16) creates a deep depth of field, keeping more of the scene sharp.
- Focal Length: Longer focal lengths (telephoto lenses) produce a shallower apparent depth of field compared to wider focal lengths, even at the same aperture and subject distance.
- Subject Distance: The closer your camera is to the subject, the shallower the depth of field becomes. This is why macro photography has an extremely thin plane of focus.
- Sensor Size: While not a direct factor in the physics formula, sensor size has a practical impact. To get the same field of view as a full-frame camera, a crop-sensor camera must be positioned further away or use a wider lens, both of which increase DoF. This is why it’s often easier to achieve shallow DoF with larger sensors.
- Circle of Confusion (CoC): This is a technical parameter representing the largest blurred point that a human eye will still perceive as sharp. It’s determined by sensor size and viewing conditions and is a core variable in any accurate depth of field calculator.
- Distance to Background: While not a direct factor in the calculation, moving your subject further away from the background will make the background appear more blurred, enhancing the effect of a shallow depth of field.
For more on lenses, check out our camera lenses guide.
Frequently Asked Questions (FAQ)
1. What is the easiest way to get a blurry background?
Use the widest aperture your lens allows (the smallest f-number, like f/1.8), use a longer focal length (like 85mm or more), get closer to your subject, and make sure there is plenty of distance between your subject and the background.
2. Why do my landscape photos look blurry even at f/16?
This could be due to focusing at the wrong spot or lens diffraction. For maximum sharpness, use a depth of field calculator to find the hyperfocal distance and focus there. Also, most lenses are sharpest around f/8 or f/11, and can become softer at very narrow apertures like f/16 or f/22 due to diffraction.
3. Does sensor size directly affect depth of field?
Technically, no. The physics of DoF depend on aperture, focal length, and distance. However, because sensor size changes the field of view, it indirectly affects depth of field. To get the same composition on a smaller sensor, you need to change your distance or focal length, which in turn alters the DoF.
4. What is the ‘Circle of Confusion’ (CoC)?
The Circle of Confusion is the largest a point of light can be on the sensor before our eyes perceive it as a blurry dot instead of a sharp point. This value is dependent on the sensor size and is a fundamental component of the depth of field formula.
5. How do I use the hyperfocal distance?
By focusing your lens at the hyperfocal distance, you achieve the maximum possible depth of field for that aperture, extending from half the hyperfocal distance all the way to infinity. This is a classic technique for landscape photography. Our hyperfocal distance calculator can help with this.
6. Why does the depth of field seem so shallow in macro photography?
Depth of field decreases exponentially as you get closer to your subject. In macro photography, the subject distance is extremely small, resulting in a depth of field that can be mere millimeters thick, even with a narrow aperture.
7. Do I need to use this calculator for every shot?
Not at all. With practice, you’ll develop an intuition for how your favorite lens and aperture combinations behave. However, for critical situations, especially in landscape or macro work, using a depth of field calculator ensures you get the shot exactly as you envision it.
8. Why do smartphones have trouble creating natural background blur?
Smartphones have very small sensors and very wide focal length lenses. Both of these factors lead to a naturally very deep depth of field. They simulate background blur (or “bokeh”) using software and depth mapping, which is why it can sometimes look artificial compared to the optical blur from a larger camera.
Related Tools and Internal Resources
Expand your photography knowledge with our other guides and tools.
- Hyperfocal Distance Calculator: Maximize sharpness in your landscape photos.
- What is Aperture?: A deep dive into the most critical setting for controlling light and DoF.
- Understanding ISO: Learn how ISO affects your image quality and exposure.
- Shutter Speed Guide: Master motion in your photos, from freezing action to creating silky smooth water.
- Exposure Triangle Explained: See how aperture, shutter speed, and ISO work together.
- Camera Lenses Guide: A comprehensive overview of different lens types and when to use them.