Calculators.Life Calculator
Physics

Depth of Field Calculator

Input Parameters

Scenarios
Focal length of the lens in millimeters (mm)
Aperture ratio N (e.g., 2.8 for f/2.8)
Distance from camera to subject in meters (m)

Computed Results

Depth of Field (DoF)
0.254
Near Limit of Acceptable Sharpness1.8811
Far Limit of Acceptable Sharpness2.135
Hyperfocal Distance30.8382

The depth of field calculator determines the range of acceptable sharpness in a photograph. By entering your sensor size, focal length, aperture, and focusing distance, you can estimate the exact near and far focus limits, total depth of field, and hyperfocal distance for your specific camera setup.

How to Use the Depth of Field Calculator

Follow these steps to determine your focus limits and total depth of field:

  1. Select Sensor Size: Choose your camera's sensor format (e.g., full frame, APS-C, Micro Four Thirds). This determines the circle of confusion used in the calculation.
  2. Enter Lens Focal Length (f): Input the true focal length of your lens in millimeters (mm), not the full-frame equivalent.
  3. Enter Aperture (f-stop): Provide the f-number you plan to use (e.g., 2.8, 5.6, 11).
  4. Enter Focusing Distance (u): Input the distance from the camera sensor to your subject in meters (m).

Once calculated, you can visualize the results on the Depth of Field Range and Focus Limits chart.

Formulas and Calculation Method

The calculator uses standard optical physics formulas to determine depth of field. The calculations rely on a specific Circle of Confusion (c) value, which varies by sensor size (e.g., 0.029mm for full frame, 0.018mm for Canon APS-C).

Hyperfocal Distance (H)

The hyperfocal distance is the closest focusing distance that keeps objects at infinity acceptably sharp.

H = f + (f² ÷ (N × c))

Where f is focal length, N is the f-number, and c is the circle of confusion.

Near and Far Focus Limits

These formulas determine the closest and furthest points of acceptable sharpness based on the subject distance (u).

Near Limit = (H × u) ÷ (H + (u − f))
Far Limit = (H × u) ÷ (H − (u − f))

Total Depth of Field

The total depth of field is simply the difference between the far limit and the near limit.

Depth of Field = Far Limit − Near Limit

Note: If the far limit reaches infinity, the calculator outputs 999999.

Inputs and Outputs Reference

FieldTypeDescription
Sensor SizeInputThe physical format of the camera sensor, which dictates the circle of confusion.
Lens Focal Length (f)InputThe focal length of the lens in millimeters (mm).
Aperture (f-stop)InputThe aperture ratio N (e.g., 2.8 for f/2.8).
Focusing Distance (u)InputDistance from the camera to the subject in meters (m).
Depth of Field (DoF)OutputThe total distance between the near and far limits of acceptable sharpness.
Near LimitOutputThe closest distance to the camera that appears acceptably sharp.
Far LimitOutputThe furthest distance from the camera that appears acceptably sharp.
Hyperfocal DistanceOutputThe focusing distance that maximizes depth of field from half that distance to infinity.

Verified Scenario Walkthroughs

Here are four examples demonstrating how different camera settings impact depth of field.

Macro Photography with Small Sensor

Using a 1-inch sensor with a 25mm lens at f/1.8, focused on a subject 0.5 meters away:

Portrait Session on Medium Format

Using a medium format sensor with an 80mm lens at f/2.0, focused on a subject 3.5 meters away:

Wildlife Telephoto Shot

Using a Canon APS-C sensor with a 400mm lens at f/5.6, focused on a subject 25 meters away:

Landscape Wide Angle Deep Focus

Using a Micro Four Thirds sensor with a 12mm lens at f/11, focused on a subject 10 meters away:

Practical Use Cases

Landscape Photography

Landscape photographers use the hyperfocal distance output to maximize sharpness across an entire scene. By focusing exactly at the hyperfocal distance, everything from half that distance all the way to infinity will remain acceptably sharp.

Portrait Photography

Portrait photographers often want a shallow depth of field to separate the subject from the background. By adjusting the aperture and focusing distance inputs, you can calculate exactly how much of the subject (e.g., just the eyes and nose) will be in focus before the background blurs.

Macro Photography

When shooting close-up subjects, depth of field shrinks dramatically, often to mere millimeters. The calculator helps macro photographers determine if they need to stop down their aperture further to keep an entire insect or flower petal in focus.

Frequently Asked Questions

What does a far limit of 999999 mean?

In this calculator, 999999 represents infinity. This occurs when your focusing distance is at or beyond the hyperfocal distance, meaning everything from the near limit to the horizon will be acceptably sharp.

How does sensor size affect depth of field?

Sensor size changes the circle of confusion used in the calculation. Generally, larger sensors require longer focal lengths or closer focusing distances to achieve the same framing as smaller sensors, which results in a shallower depth of field at the same aperture.

Should I use the full-frame equivalent focal length?

No. You should always enter the true, physical focal length printed on your lens. The calculator accounts for the crop factor automatically when you select your specific sensor size.

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.