Depth of Field Calculator
Last updated: 2026-09-01
| Focal length (mm) | Aperture (f/) | Distance | |
|---|---|---|---|
| Small print | 25 | 1 | 3 |
| Standard | 38 | 2 | 3 |
| Large poster | 50 | 3 | 3 |
| Banner | 75 | 4 | 3 |
| Billboard | 100 | 6 | 3 |
TL;DR: To calculate the depth of field, use the formula DOF = 2u²Nc / f⁴, where 'u' is the focus distance, 'N' is the f-number, 'c' is the circle of confusion, and 'f' is the focal length—or simply enter your camera's focal length, aperture, focus distance, and sensor size into this calculator to get the near and far focus limits instantly.
What Is the Depth of Field Calculator?
The Depth of Field Calculator is a precision tool designed for photographers, videographers, and cinematographers who need to determine exactly how much of their scene will appear acceptably sharp. Depth of field (DOF) is the distance between the nearest and farthest objects in a scene that appear sharp in an image. This calculator computes that range in real time, allowing you to plan shots with surgical precision before you even press the shutter.
Who needs this tool? Every visual storyteller. Portrait photographers use it to isolate subjects with creamy backgrounds (shallow DOF). Landscape photographers use it to ensure foreground rocks and distant mountains are both tack sharp (deep DOF). Macro photographers use it to manage sub-millimeter focus ranges. Videographers use it to control focus pulls during a scene. The calculator turns a complex optical formula into an instant, actionable number, eliminating guesswork and saving you from costly retakes.
The core concept relies on a critical optical parameter called the circle of confusion (CoC)—the largest blur spot your eye perceives as a single point. This value is directly tied to your sensor size. A full-frame sensor uses a CoC of approximately 0.029 mm, while an APS-C sensor uses roughly 0.019 mm. The calculator accounts for this automatically, so you don't need to memorize these constants.
How to Use the Calculator
Using this depth of field calculator is straightforward, but precision in your inputs is essential. Follow this exact sequence for accurate results:
- Enter Focal Length: Input the actual focal length of your lens (e.g., 50 for a 50mm prime). If using a zoom lens, use the current focal length setting. Never use the "35mm equivalent" or "full-frame equivalent" value—the calculator uses the physical focal length.
- Set the Aperture (f-number): Enter the f-stop you intend to shoot at (e.g., 2.8, 4, 8, 16). This is the denominator of the fraction; do not enter the letter 'f'—just the number. Lower numbers (f/1.4) mean a larger aperture and shallower depth of field.
- Specify Focus Distance: Input the distance from the camera's sensor plane to your subject. This is not the distance from the front of the lens. Most cameras mark the sensor plane with a circle-and-line symbol on the top plate. For precision, focus on the subject and read the distance on the lens barrel, or measure with a laser rangefinder.
- Select the Unit: Choose between meters and feet. Critical: never mix unit systems—if your focus distance is in feet, the calculator will output near and far limits in feet.
- Pick Sensor Size: Select your camera's sensor format (Full Frame, APS-C, Micro Four Thirds, or 1-inch). This automatically sets the correct circle of confusion value. If you own a medium-format camera, select "Custom" and input your exact CoC value from your camera's manual.
- Click Calculate: The calculator will immediately display your near focus limit, far focus limit, total depth of field, and hyperfocal distance.
Formula and Calculation Method
The calculator uses the standard photographic depth of field equations, which are derived from Gaussian lens theory. In plain language: the depth of field is larger when you use a short focal length, a small aperture (large f-number), or focus at a greater distance. It is smaller when you use a telephoto lens, a wide aperture, or focus close to the subject.
The two primary equations used are:
- Near limit: DN = (u × f²) / (f² + N × c × (u - f))
- Far limit: DF = (u × f²) / (f² - N × c × (u - f))
Where:
- u = focus distance (in mm)
- f = focal length (in mm)
- N = f-number (aperture)
- c = circle of confusion (in mm)
The total depth of field is simply the difference between the far and near limits: DOF = DF - DN. The calculator performs these calculations internally using consistent millimeter units to prevent rounding errors.
Worked Example with Real Numbers:
Let's calculate the depth of field for a portrait shot with a full-frame camera. We will use a 85mm lens at f/1.8, focusing on a subject 3 meters away. The circle of confusion for full-frame is 0.029 mm.
Step 1: Convert focus distance to millimeters: 3 meters = 3000 mm.
Step 2: Calculate the denominator for the near limit: f² + N × c × (u - f) = 85² + 1.8 × 0.029 × (3000 - 85) = 7225 + 152.13 = 7377.13
Step 3: Calculate the near limit: DN = (3000 × 7225) / 7377.13 = 21,675,000 / 7377.13 = 2938.1 mm (approximately 2.94 meters)
Step 4: Calculate the denominator for the far limit: f² - N × c × (u - f) = 7225 - 152.13 = 7072.87
Step 5: Calculate the far limit: DF = (3000 × 7225) / 7072.87 = 21,675,000 / 7072.87 = 3064.6 mm (approximately 3.06 meters)
Step 6: Total DOF = 3064.6 - 2938.1 = 126.5 mm (about 12.6 cm or 5 inches).
This tells you that with a 85mm lens at f/1.8, only a 12.6 cm band will be in sharp focus. This is why portrait photographers must nail focus on the eye—the eyelashes will blur if the focus is off.
Practical Examples
Here are three realistic shooting scenarios showing how the calculator behaves with different inputs. All assume a full-frame sensor (CoC = 0.029mm).
| Scenario | Focal Length | Aperture | Focus Distance | Total DOF | Practical Result |
|---|---|---|---|---|---|
| Landscape | 24 mm | f/11 | 10 m | Infinity (from 1.98 m to ∞) | Everything from the foreground to the horizon is sharp—perfect for scenic shots. |
| Street Portrait | 35 mm | f/2.8 | 2 m | 0.39 m (39 cm) | Subject is sharp, background begins to blur—good contextual portrait. |
| Macro Insect | 100 mm | f/4 | 0.3 m | 1.4 mm | Extremely thin slice of focus—requires focus bracketing or a tripod rail for success. |
The landscape scenario reveals a crucial insight: at 24mm and f/11, the hyperfocal distance is approximately 1.98 meters. If you focus at 1.98 meters, everything from about 0.99 meters to infinity is sharp, which is often more practical than focusing directly on infinity itself.
Tips for Accurate Results
To get reliable depth of field calculations, avoid these common pitfalls and follow these professional guidelines:
- Match your unit system: The most frequent error is entering a focus distance in feet but expecting a result in meters. Check the unit selector before calculating. The calculator performs all internal math in millimeters, but the output matches your input selection.
- Include a safety margin for critical work: The depth of field formula assumes a specific viewing size (typically an 8×10 print). If you will crop heavily or print very large (e.g., billboards), add 5-10% more sharpness by stopping down one-third to one-half stop. For example, if your calculation says f/8 works, actually shoot at f/9 or f/10 to compensate.
- Verify your circle of confusion defaults: The calculator's sensor presets use industry-standard CoC values (0.029mm for full-frame, 0.019mm for APS-C). However, if you shoot for pixel-peeping audiences or print at extreme sizes, use a smaller CoC value to be stricter. Don't blindly trust defaults—adjust them for your specific output.
- Use the real focal length, not the equivalent: On a crop-sensor camera, a 50mm lens is physically 50mm. The "75mm equivalent" is irrelevant for DOF calculation—it filters into the sensor size setting instead.
- Measure focus distance from the sensor plane: The distance marked on your lens barrel is measured from the sensor, but if you measure from the filter thread or the front of the lens hood, you will introduce significant errors at close distances. Always use the sensor plane marking.
- Be careful with close-focus distances: At macro distances (less than 10× the focal length), the formula becomes increasingly sensitive to input errors. A 1mm mistake at 100mm macro distance changes the DOF drastically. Use a focus rail with measurements for macro work.
Frequently Asked Questions
Does the depth of field change when I zoom in or move closer?
Yes, and they are related in a surprising way. Depth of field is determined by four variables: focal length, aperture, focus distance, and sensor size. However, the key insight is that the effect of focal length and distance often cancel each other out. If you double your focal length (e.g., from 50mm to 100mm) and double your distance to the subject (from 2m to 4m), the depth of field remains roughly the same. This is why "compression" appears not to change background blur in practice. To decrease depth of field reliably, open your aperture wider (lower f-number) or move physically closer to your subject while keeping the same focal length. If you want to decrease DOF by moving closer, be aware your framing will change—you are cropping the scene. This is why portrait photographers often say "zoom with your feet" to get shallower depth of field.
What is the hyperfocal distance and how do I use it?
The hyperfocal distance is the distance at which you can focus your lens to achieve the maximum possible depth of field—specifically, the point where everything from half the hyperfocal distance to infinity appears sharp. The calculator outputs this value automatically. To use it in landscape photography: set your lens to manual focus, focus at the hyperfocal distance (e.g., 1.98m in the 24mm landscape example above), and you will get sharp results from 0.99m to infinity. The formula for hyperfocal distance is H = (f² / (N × c)) + f. Note that using the hyperfocal distance is not always ideal—if your foreground subject is closer than half the hyperfocal distance, you will need to focus closer and accept an out-of-focus background. Modern landscape photographers often focus at the foreground subject for maximum sharpness there, rather than using strict hyperfocal focusing.
Why does my phone camera have a "portrait mode" if smaller sensors have more depth of field?
This is exactly why smartphone portrait mode is a computational trick. A phone's sensor is tiny (often 1/1.7-inch), meaning its actual focal length is extremely short (about 4-6mm). According to the depth of field formula, a short focal length and small sensor produce a massive depth of field—sometimes everything from a few centimeters to infinity is sharp. This is actually an advantage for snapshots (no focus errors) but terrible for portraits. To simulate a shallow depth of field, smartphones use the main camera to capture the image while simultaneously using depth-sensing data from a secondary camera or phase detection pixels. The software then estimates the distance map of the scene and applies a blur to the background in post-processing. The calculator cannot replicate this computational effect because it relies on real optics. If you want genuine shallow depth of field, you need a larger sensor (APS-C or full-frame) with a fast prime lens (e.g., 85mm f/1.4) and physically move away from your subject to increase focus distance, which slightly increases the background blur relative to the subject size.
FAQ
What is depth of field and how does this calculator determine it?
Depth of field is the zone of acceptable sharpness in front of and behind your focus point, and this calculator computes that zone using your lens focal length, aperture (f-stop), focus distance, and camera's sensor size or circle of confusion. It accounts for the fact that sharpness falls off gradually, not abruptly, and gives you near and far limits based on standard optical formulas like the hyperfocal distance equations.
How do I input my camera's sensor size correctly?
You should select the sensor size that matches your camera, such as Full Frame, APS-C, Micro Four Thirds, or a custom circle of confusion value if you prefer precise control. If you use a crop sensor, the calculator automatically applies the crop factor to your lens's actual focal length and aperture, so you get an equivalent depth of field result that matches real-world shooting conditions.
Why does the depth of field change when I adjust only the focus distance?
Depth of field is not fixed for a given lens and aperture; it expands as you focus farther away and contracts as you focus closer. Specifically, the near limit and far limit of sharpness are non-linearly dependent on the focus distance, because the ratio of distances changes, and at very close distances the depth of field becomes extremely thin while at distant focus it approaches the hyperfocal distance.
What is the hyperfocal distance and how can this calculator help me use it?
The hyperfocal distance is the closest focus distance at which everything from half that distance to infinity appears acceptably sharp, and it is a key feature of this calculator that you can compute instantly for any lens and aperture combination. By entering your settings, the calculator shows you the exact hyperfocal distance, allowing you to set your lens to that focusing point and maximize depth of field for landscape photography or other scenarios where you want everything in focus.