Depth of Field Calculator

Stephanie Ben-Joseph headshot Stephanie Ben-Joseph

What is depth of field?

Depth of field (DOF) is the distance range in front of your camera where objects appear acceptably sharp. Everything inside this zone looks in focus; anything in front of the near limit or behind the far limit gradually turns blurry.

Photographers use DOF creatively:

  • Shallow depth of field isolates a subject with a blurred background, ideal for portraits.
  • Deep depth of field keeps most of the scene sharp, ideal for landscapes and architecture.

This depth of field calculator lets you predict near focus distance, far focus distance, total DOF, and hyperfocal distance based on your camera settings. It is especially helpful when you want to plan shots before you are on location.

Inputs this DOF calculator uses

The tool relies on four main variables that control depth of field:

  • Aperture (f-number) – A smaller f-number (for example, f/1.8) means a wider aperture and a shallower depth of field. A larger f-number (such as f/11 or f/16) increases depth of field.
  • Focal length – Longer focal lengths (telephoto lenses such as 85 mm, 135 mm, 200 mm) give a tighter field of view and usually produce shallower depth of field at the same framing.
  • Subject distance – The closer you are to your subject, the shallower the depth of field. Backing up increases the distance that appears sharp.
  • Sensor size – For the same framing and aperture, smaller sensors (APS‑C, Micro Four Thirds) generally show more depth of field than a full‑frame sensor.

The default values of f/2.8, 50 mm, and 5 m are typical for a full‑frame environmental portrait or general‑purpose scene. You can adjust them to match your lens and shooting distance.

Formulas used in the depth of field calculations

Internally, the calculator works with distances in millimetres to keep the formulas consistent. Three key quantities are used: the circle of confusion, the hyperfocal distance, and the near and far focus limits.

Circle of confusion (CoC)

The circle of confusion is the largest blur spot that still appears sharp to a viewer at a typical viewing distance. This calculator uses common approximate values:

  • Full‑frame (35 mm): c = 0.03 mm
  • APS‑C: c = 0.02 mm
  • Micro Four Thirds: c = 0.015 mm

Hyperfocal distance

The hyperfocal distance is the focus distance at which everything from half that distance out to infinity is acceptably sharp (for a given aperture and sensor size). The formula is:

H = f2 Nc + f

where:

  • H is the hyperfocal distance
  • f is the focal length of the lens
  • N is the f‑number (aperture)
  • c is the circle of confusion for the chosen sensor size

Near and far focus distances

Let s be the focus distance to your subject (in the same units as H). The near and far limits that define the depth of field are calculated as:

D_n = Hs H+sf D_f = Hs Hsf

The total depth of field is then simply:

DOF = Df − Dn

If s is greater than or equal to H, the far distance is treated as infinity, which is what you want for many landscape photos.

How to interpret the results

After you click the calculate button, the tool will display four main values:

  • Near focus distance – The closest point that will appear acceptably sharp.
  • Far focus distance – The furthest point that will appear acceptably sharp. This may be shown as infinity.
  • Total depth of field – The distance between the near and far limits.
  • Hyperfocal distance – The special focus distance that maximises depth of field from half that distance to infinity.

To use this information in the field:

  • Compare the total depth of field with the size of your subject or scene.
  • Check whether important foreground and background elements fall inside the near and far distances.
  • Adjust aperture, subject distance, or focal length and recalculate until the sharp zone matches your creative intent.

Worked example

Imagine you are shooting a portrait on a full‑frame camera with a 50 mm lens at f/2.8, and your subject is 5 m away. Enter:

  • Aperture: f/2.8
  • Focal length: 50 mm
  • Subject distance: 5 m
  • Sensor size: Full‑frame

The calculator will return approximate values such as:

  • Near distance: around 4.4 m
  • Far distance: around 5.8 m
  • Total depth of field: roughly 1.4 m
  • Hyperfocal distance: several tens of metres

This tells you that your subject at 5 m sits roughly in the middle of a 1.4 m wide sharp zone. The background much farther away will be noticeably blurred, which is usually flattering for portraits.

If you stop down to f/8 and keep the other values the same, the calculator will show a much larger depth of field. Both the near and far limits move farther apart, so more of the environment comes into focus. You can use this to include more context in the scene while still keeping your subject sharp.

Depth of field comparison by sensor size

For the same framing and aperture, smaller sensors tend to produce more depth of field. The table below summarises typical behaviour when you keep composition similar.

Sensor size Typical CoC used Relative depth of field Practical implications
Full‑frame (35 mm) 0.03 mm Shallowest DOF for the same framing and f‑number Excellent for strong background blur and subject isolation.
APS‑C 0.02 mm More DOF than full‑frame at same framing Easier to keep subjects sharp at moderate apertures.
Micro Four Thirds 0.015 mm Greatest DOF for the same framing Very convenient for travel and landscape work where you want more of the scene in focus.

To compare systems fairly, match the angle of view and subject distance, then try equivalent f‑numbers. For example, a 50 mm lens at f/2.8 on full‑frame gives a similar field of view to around 35 mm f/2 on APS‑C or 25 mm f/1.4 on Micro Four Thirds, but the resulting depth of field will still be different.

Assumptions and limitations

This depth of field calculator is designed as a practical planning aid, not a substitute for test shots. It makes several simplifying assumptions:

  • Standard viewing conditions – The circle of confusion values assume a typical print size and viewing distance. Very large prints or close viewing will effectively reduce DOF.
  • Still photography – The model is aimed at single frames, not video. Motion blur, subject movement, and camera shake are not considered.
  • Ideal lens behaviour – Effects such as focus breathing, field curvature, and complex bokeh characteristics are ignored. Real lenses may behave slightly differently.
  • No diffraction limits – At very small apertures (for example, f/16, f/22), diffraction softening can reduce perceived sharpness even though the geometric depth of field is large.
  • Approximate distances – Camera‑reported focus distances are often rounded. Treat the results as estimates rather than exact boundaries.

Because of these factors, always confirm critical focus on your camera’s display, especially for macro work, very shallow DOF portraits, or important commercial shoots.

Using the DOF calculator in practice

Here are some quick ways to get value from the tool:

  • Portraits – Start around f/2 to f/2.8 on full‑frame (or f/1.4 to f/2 on smaller sensors) and check that the depth of field comfortably covers the subject’s eyes and face.
  • Landscapes – Use the hyperfocal distance result to choose a focus point that keeps both foreground details and distant mountains sharp.
  • Macro – Expect extremely thin depth of field at close distances. Experiment with smaller apertures, focus stacking, or slightly backing up and cropping later.

By iterating between your settings and the calculated results, you can quickly find a combination that balances background blur, subject sharpness, and available light for the scene in front of you.

Enter your lens and subject data to see depth of field.

Embed this calculator

Copy and paste the HTML below to add the Depth of Field Calculator – Near/Far Focus, Total DOF & Hyperfocal... to your website.