Depth of Field Calculator

Depth of Field Calculator

Estimate the near and far limits of acceptable sharpness for a camera, lens, aperture, and focusing distance, with a built-in hyperfocal check.

35mm full frame 50 mm f/4 3.000 m

Workbook ready for the demonstration setup.

Camera and lens inputs

Presets supply a conventional circle-of-confusion limit for the format.

mm

Enter 1 – 2,000 mm using a dot as the decimal separator.

Higher f-numbers generally increase calculated depth of field.

m

Distance from the camera's optical reference plane to the subject.

Advanced sharpness assumption
mm

Optional. Leave blank to use the selected sensor's conventional value; accepted override range 0.001 – 0.200 mm.

Live results

Depth of field (DoF)

0.835 m

Calculated span between the near and far acceptable-sharpness limits.

DoF near limit

2.640 m

DoF far limit

3.474 m

Hyperfocal distance

21.602 m

Circle of confusion used

0.029 mm

Depth of field is 0.835 m, from 2.640 m to 3.474 m.

Focus range details

Measure Current value
Near acceptable-sharpness limit 2.640 m
Focused subject plane 3.000 m
Far acceptable-sharpness limit 3.474 m
Total depth of field 0.835 m
Hyperfocal distance 21.602 m

These limits are optical planning estimates based on an acceptable circle of confusion, not hard physical boundaries where sharpness suddenly changes.

How to use this depth of field calculator

What this calculator does

This calculator estimates the zone in front of and behind your focused subject that should appear acceptably sharp under a conventional circle-of-confusion criterion. It reports the Depth of field (DoF), the DoF near limit, the DoF far limit, the Hyperfocal distance, and the Circle of confusion used. It is useful for planning focus and aperture before a portrait, product shot, group photo, landscape, or other scene where you care about how much depth looks sharp. It does not predict lens aberrations, diffraction, autofocus error, subject motion, pixel-level sharpness, or the artistic quality of background blur. Sharpness also fades gradually rather than stopping abruptly at the reported limits, a practical point emphasized in ZEISS guidance on depth of field and circle of confusion.

When to use it

Use the calculator when you want to check whether both eyes and ears are likely to fall inside a portrait's focus zone, decide how far to stop down for a group arranged in several rows, estimate whether foreground and background elements can fit inside one landscape focus range, or compare how a longer lens or shorter focusing distance changes the available margin around a subject. The result is best treated as a repeatable planning estimate that you can verify with your camera's depth-of-field preview, magnified live view, or a test frame.

How to calculate

  1. The calculator opens with a ready-to-use demonstration: a 35mm full-frame sensor, 50 mm lens, f/4 aperture, and a 3 m focusing distance. The example results and a validated Excel workbook are available immediately.
  2. Choose Sensor size. If your format is not listed, select Custom sensor size and enter the sensor width and height in millimeters.
  3. Replace Lens focal length (f), choose Aperture f-stop, and enter Focusing distance (u) in meters. Results recalculate live; no Calculate button is required.
  4. Open Advanced sharpness assumption only if you want to enter a stricter or looser Circle of confusion override. Leave it blank to use the format preset.
  5. Read the near and far limits as distances from the camera, then compare them with the nearest and farthest important details in your scene. Use Hyperfocal distance as a reference for scenes where you want the far limit to extend to infinity.
  6. Select Download Excel to export the current inputs and calculated values as a real .xlsx workbook. Reset clears the demonstration's data values and calculated content; Excel export is then disabled until a complete valid state is entered again.

Input guide

Sensor size is a required preset or custom format selection. The listed dimensions are in millimeters. A smaller sensor preset uses a smaller conventional circle-of-confusion allowance. For example, 35mm full frame uses about 0.029 mm here. A common mistake is to treat sensor format as if it physically changes the lens focal length; it does not. Instead, sensor format affects framing and the sharpness criterion used for comparison. Nikon's photography glossary provides concise definitions of aperture, APS-C, focal length, and depth of field.

Custom sensor width and Custom sensor height are required only after selecting Custom sensor size. Enter plain positive decimal millimeters from 1 to 100, such as 23.5 and 15.6. The calculator derives a conventional circle of confusion from the sensor diagonal divided by 1,500. A typo that swaps millimeters for centimeters can make the sharpness allowance unrealistically large.

Lens focal length (f) is required in millimeters from 1 to 2,000; 50 is a typical normal-lens example. At the same aperture and focus distance, increasing focal length generally narrows the calculated focus zone. Enter a dot decimal if needed; scientific notation and decimal commas are rejected rather than silently reinterpreted.

Aperture f-stop is a required f-number selected from standard values. The demonstration uses f/4. Moving to a higher f-number such as f/8 or f/11 generally increases depth of field because the physical aperture opening becomes smaller relative to focal length. Do not confuse a higher f-number with a wider opening.

Focusing distance (u) is required in meters and must be farther than the lens focal length converted to meters. The sample value is 3 m. Increasing focus distance usually expands depth of field substantially; moving close to a subject can make it very shallow. Measure from the camera's sensor-plane reference when precision matters.

Circle of confusion override is optional and uses millimeters from 0.001 to 0.200. A smaller value imposes a stricter acceptable-sharpness criterion and therefore reduces the reported depth of field. Leave the field blank for the sensor preset. A frequent interpretation mistake is treating CoC as a property of the lens alone; it is an adopted sharpness threshold influenced by format and viewing assumptions.

Output guide

Depth of field (DoF) is the total modeled distance from the near limit to the far limit. A small value indicates a shallow acceptable-sharpness zone, while a large value indicates more depth. DoF near limit and DoF far limit are absolute distances from the camera to the two boundaries. If the far limit mathematically reaches infinity, the calculator displays “At infinity” instead of forcing a finite number. Hyperfocal distance is the focusing distance associated with extending the far limit to infinity under the same focal length, aperture, and CoC assumption. Circle of confusion used confirms which sharpness threshold actually drove the calculation, including any optional override.

The Focus range details table repeats those outputs alongside the Focused subject plane. Its “Current value” column uses meters for scene distances and preserves “At infinity” for an unbounded far limit. The header pills summarize the selected sensor, focal length, aperture, and focusing distance; they are context summaries rather than additional formulas.

Worked example

With the startup setup – 35mm full frame, 50 mm, f/4, 3.000 m focus distance, and the 0.029 mm preset circle of confusion – the hyperfocal distance is 21.602 m. Applying the standard near-limit equation gives 2.640 m, while the far-limit equation gives 3.474 m. Their difference is 0.835 m, which is the displayed depth of field. This means an object around 2.64 m from the camera sits near the front boundary of the adopted acceptable-sharpness zone, while an object around 3.47 m sits near the rear boundary. The focus plane remains at exactly 3.00 m.

How the depth-of-field model works

The calculator first determines the hyperfocal distance, then uses that value to calculate the near and far acceptable-sharpness limits. The equations use focal length f and circle of confusion C in millimeters, aperture f-number N, and focusing distance u in the same length unit before converting the reported distances back to meters.

H = f + f²/(N × C) · Near = H × u / (H + (u – f)) · Far = H × u / (H – (u – f))

When the far-limit denominator is zero or negative, the theoretical far boundary is at infinity; the total depth of field is therefore unbounded in that direction rather than a finite meter value. This behavior is closely related to hyperfocal focusing. For a deeper conceptual treatment of acceptable sharpness, viewing distance, and print enlargement, see the Cambridge in Colour depth-of-field tutorial.

Practical interpretation and tradeoffs

Stopping down to a higher f-number can expand calculated depth of field, but that does not mean “more is always better.” Exposure changes with aperture, and very small apertures can introduce diffraction that reduces fine-detail sharpness. Similarly, a computed boundary should not be read as a cliff: optical blur grows continuously as objects move away from the exact focus plane. For critical work, use the calculation to choose a promising setup, then inspect the actual image at the output size that matters.

Focal length and distance also interact with composition. A longer lens at the same camera position changes framing, while moving the camera to preserve framing changes perspective. For that reason, depth-of-field comparisons are most useful when you keep the intended composition explicit instead of changing multiple variables without tracking why. The cleanest workflow is to decide the subject framing first, measure or estimate subject distance, choose an aperture that meets both exposure and focus-range needs, and then test the result.