Depth of Field Calculator

Last updated: 2026-09-01

Depth of Field Calculator — Free online depth of field calculator. Enter focal length and aperture to get instant results.
Inputs
mm
f/
mm
Result
Enter values and press Calculate
Common Examples — Click to Fill
Focal lengthApertureDistanceCircle of confusion
Small print 25130.03
Standard 38230.03
Large poster 50330.03
Banner 75430.03
Billboard 100630.03

TL;DR: To calculate the depth of field, you must determine the near and far focus distances using your lens's focal length, aperture (f-number), focus distance, and a Circle of Confusion (CoC) value—the depth of field formula is: Near Limit = (H × S) / (H + (S − F)) and Far Limit = (H × S) / (H − (S − F)), where H is the hyperfocal distance calculated as H = (F² / (A × CoC)) + F.

What Is the Depth of Field Calculator?

The Depth of Field Calculator is a free online tool designed for photographers, videographers, and cinematographers who need instant, accurate focus range data for any lens and camera combination. Instead of manually solving complex lens equations or consulting bulky printed charts, you simply enter your focal length, aperture, focus distance, and sensor size to receive the complete depth of field breakdown: the near limit, far limit, total depth, and hyperfocal distance.

In practical terms, this calculator answers the fundamental photographic question: "If I focus on a subject at 5 meters with a 50mm lens at f/2.8 on a full-frame camera, how much of the scene in front of and behind that subject will appear acceptably sharp?" This is critical for portrait photographers isolating subjects from backgrounds, landscape photographers trying to maximise sharpness from foreground to horizon, and macro shooters dealing with millimetres of focus latitude. Without this calculation, photographers rely on guesswork—often resulting in missed focus or unintentionally blurred elements.

The calculator accounts for the physical realities of optics. Depth of field is not a fixed property of a lens; it changes dramatically based on sensor size (which dictates the Circle of Confusion), focal length, aperture, and subject distance. A 24mm lens at f/8 on a smartphone produces almost infinite depth of field, while a 200mm lens at f/2.8 on a full-frame camera yields razor-thin focus. This tool eliminates the mathematical friction, providing you with precise, actionable numbers in seconds.

How to Use the Calculator

Using the Depth of Field Calculator is straightforward. Follow this step-by-step process:

  1. Select your camera sensor size. Choose from the provided presets (e.g., Full Frame, APS-C, Micro Four Thirds, or 1-inch). This setting automatically determines the Circle of Confusion value, which is essential for accurate results. If your camera uses a non-standard sensor, input the custom CoC value manually.
  2. Enter the focal length (mm). Type the actual focal length of your lens. For a zoom lens, use the specific focal length you will be shooting at (e.g., enter "50" for a 24-70mm lens set to 50mm).
  3. Set the aperture (f-number). Input your f-stop value (e.g., f/2.8, f/4, f/8, f/16). Use the standard aperture value, not the T-stop.
  4. Enter the focus distance. Provide the distance from your camera's sensor plane to the subject you are focusing on. The calculator accepts measurements in feet or metres—ensure you select the correct unit before inputting the number.
  5. Press 'Calculate.' The results will display immediately: near focus limit, far focus limit, total depth of field, and hyperfocal distance.
  6. Review the output. Normalise the results to your preferred unit (feet or metres). The total depth is the difference between the far and near limits.

All inputs are mandatory except for the "Custom CoC" field, which is only required when you select a custom sensor size. Always double-check your measurement units before calculating—entering metres when feet are expected will produce wildly incorrect results.

Formula and Calculation Method

The Depth of Field Calculator relies on standard optical formulas derived from geometric optics. The core concept is the Circle of Confusion (CoC)—the maximum diameter a point of light can spread on the sensor while still appearing sharp to the human eye at a standard viewing distance. Smaller sensors require smaller CoC values, which in turn produce shallower depth of field at identical apertures and focal lengths.

The calculation proceeds in two stages. First, the calculator determines the hyperfocal distance (H), which is the nearest focus distance at which everything from half that distance to infinity appears acceptably sharp. The formula is:

H = (F² / (A × CoC)) + F

Where:

  • F = Focal length (in millimetres, converted to metres for consistent units)
  • A = Aperture (f-number, which is unitless)
  • CoC = Circle of Confusion (in millimetres)

Stage Two: Near and Far Limits. With H known, the near and far depth of field limits are calculated along with the total depth:

  • Near Limit (Dn) = H × S / (H + (S − F))
  • Far Limit (Df) = H × S / (H − (S − F)), where S is the focus distance and F is the focal length.
  • Total Depth of Field = Df − Dn

Worked Example: Suppose you are using a full-frame camera (CoC = 0.030 mm) with a 50mm lens set to f/4, focused on a subject at 5 metres.

Step 1: Convert focal length to metres: 50 mm = 0.05 m. CoC is 0.00003 m (0.030 mm converted).

Step 2: Calculate H: H = (0.05² / (4 × 0.00003)) + 0.05 = (0.0025 / 0.00012) + 0.05 = 20.833 + 0.05 = 20.883 metres.

Step 3: Calculate Near Limit: Dn = (20.883 × 5) / (20.883 + (5 − 0.05)) = 104.415 / 25.833 = 4.042 metres.

Step 4: Calculate Far Limit: Df = (20.883 × 5) / (20.883 − (5 − 0.05)) = 104.415 / 15.933 = 6.554 metres.

Step 5: Total Depth = 6.554 − 4.042 = 2.512 metres.

This tells you that from 4.042 metres to 6.554 metres, your subject will appear sharp—your useful range is roughly a 2.5-metre window.

Practical Examples

The calculation becomes more intuitive when applied to real-world shooting situations. The table below shows three common scenarios and their calculator outputs:

ScenarioSensor / CoCFocal LengthApertureFocus DistanceNear LimitFar LimitTotal Depth
Portrait HeadshotFull Frame (0.030 mm)85 mmf/1.82.0 m1.94 m2.06 m0.12 m (12 cm)
Street SceneAPS-C (0.020 mm)35 mmf/83.0 m1.94 m6.73 m4.79 m
LandscapeFull Frame (0.030 mm)16 mmf/115.0 m (focusing at hyperfocal)0.97 mInfinity (∞)Infinite

Interpretation: In the portrait example, you have a 12-centimetre sharp window—enough for the subject's eyes and nose but the background falls off into creamy bokeh. The street scene gives you almost 5 metres of sharp space, ideal for capturing moving subjects where precise focus is challenging. The landscape scenario demonstrates the hyperfocal technique: by focusing at the hyperfocal distance, you achieve sharpness from just under 1 metre to infinity, ensuring the entire vista is crisp.

Tips for Accurate Results

To get the most reliable depth of field data from this calculator, follow these professional guidelines:

  • Verify your Circle of Confusion. The default CoC values (0.030 mm for full frame, 0.020 mm for APS-C, 0.015 mm for Micro Four Thirds) assume a final print viewed at a normal distance. If you plan to crop heavily, print very large, or always view at 100% on screen, use a smaller CoC (e.g., 0.015 mm for full frame) for a more conservative estimate.
  • Never round intermediate results. The formula is sensitive to small variations. Calculate H to at least three decimal places before computing near and far limits. Rounding H to a whole number can shift your near limit by several centimetres, which is critical in macro photography.
  • Use consistent units. The standard formula uses metres for focal length and focus distance, but it is easy to mix units. If you are using the calculator's unit selector, set it once and stick to it. A common error is entering a 50mm focal length as "50" metres—this will produce a nonsensical result.
  • Check the validity range. The depth of field formula assumes a simple thin-lens model. It works accurately for most distances greater than 10 times the focal length. For macro photography (magnification above 1:1), use a dedicated macro calculator that accounts for pupil magnification and lens asymmetry, as the standard formula underestimates depth of field.
  • Confirm your focus distance. The focus distance is measured from the camera's sensor focal plane mark (usually indicated with the ⌽ symbol on the camera body), not from the front of the lens. Using a string or measuring tape provides reliable input data.
  • Understand aperture limitations. At very small apertures (f/22 and smaller), diffraction softens the entire image, negating any gains in depth of field. The calculator tells you the geometric depth, but your perceived sharpness will be lower than the numbers suggest.

Frequently Asked Questions

Q: How does sensor size affect the depth of field calculation?
Sensor size directly determines the Circle of Confusion value used in the formula. A full-frame sensor uses a CoC of 0.030 mm, while a Micro Four Thirds sensor uses 0.015 mm—half the diameter. Since the CoC appears in the denominator of the hyperfocal distance formula, a smaller CoC (smaller sensor) makes H larger, which reduces depth of field at the same focal length and aperture. However, photographers typically use shorter focal lengths on smaller sensors to achieve the same field of view, which increases depth of field. For example, a 25mm lens on Micro Four Thirds gives the same angle of view as a 50mm lens on full frame, but produces significantly more depth of field at f/2.8. This is why smartphone photography naturally produces images where almost everything is in focus.

Q: Could you explain the hyperfocal distance and how to use it for landscape photography?
The hyperfocal distance (H) is the focus distance at which everything from half of H to infinity appears acceptably sharp. Using the earlier example where H = 20.883 m, if you focus at 20.883 m, everything from 10.44 m to infinity will be sharp. The calculator outputs this value precisely, allowing you to set your lens's manual focus ring to that distance for maximum landscape sharpness. A common mistake is focusing at "infinity" on the lens barrel for landscapes. Instead, focus slightly closer—at the hyperfocal distance—to bring the foreground into focus while keeping distant mountains sharp. However, be aware that focusing at H often sacrifices sharpness at the absolute infinity point; for critical work, focusing at H + (focal length) is sometimes recommended, or focus stack for maximum resolution.

Q: What happens when my focus distance is less than the hyperfocal distance, and why does the far limit become infinity?
When your focus distance (S) is greater than or equal to the hyperfocal distance (H), the far limit equation's denominator becomes zero or negative, mathematically producing an infinite far limit. Visually, this means that everything from the near limit to infinity is in focus. This is exactly the scenario exploited in landscape photography—by focusing at or beyond H, you guarantee that distant elements are sharp. Conversely, when focusing closer than H (which is true for most portraits and product shots), the denominator (H − (S − F)) is positive and finite, producing a definite far limit beyond which objects become blurred. The calculator will display "Infinity (∞)" for the far limit in this case, which is not an error but a physical reality of optical physics. This boundary condition explains why telephoto lenses at wide apertures rarely produce a sharp background—the focus distance required to reach H is often impractically far away.

FAQ

What is 'depth of field' and what does this calculator actually compute?

Depth of field (DoF) is the distance range in front of and behind the focus point where objects appear acceptably sharp in a photograph. This calculator computes that range based on your camera's sensor size, lens focal length, aperture (f-stop), focus distance, and a chosen circle of confusion (CoC) value.

Which camera settings do I need to input to get accurate results?

You must enter the focal length of your lens (e.g., 50mm), the aperture (f-number, e.g., f/2.8), and the distance from the camera to your subject (in feet or meters). Additionally, select your camera's sensor format (e.g., Full Frame, APS-C, Micro Four Thirds) so the calculator can apply the correct circle of confusion value for that sensor.

Why does the depth of field change when I change the sensor format, even with the same lens and settings?

Depth of field is partly determined by the circle of confusion, which scales with sensor size—larger sensors have a larger acceptable circle, so they produce shallower depth of field at the same aperture and focal length. For example, a 50mm lens at f/2.8 on full frame gives a much shallower DoF than on a crop-sensor camera because the crop sensor magnifies the image, effectively increasing depth of field for the same framing.

Can this calculator tell me the hyperfocal distance, and how do I use that in practice?

Yes, the calculator provides the hyperfocal distance, which is the closest focus distance at which everything from half that distance to infinity appears sharp. To use it, focus your lens at the hyperfocal distance value shown (e.g., 7.5 meters) and then keep your aperture and focal length unchanged; this maximizes sharpness for landscape scenes and ensures distant objects are in focus.