Camera Math Calculators

Free Calculator · Any Sensor Format · Live Results

Depth of field — near limit, far limit, and total DoF for your shot

Depth of field is the range of distances that appear acceptably sharp in a photograph. It is controlled by aperture, focal length, focus distance, and sensor size — and the relationship between them is not intuitive. Enter your shooting parameters below and the calculator returns the near limit, far limit, total DoF, and hyperfocal distance using the standard optical formulas, with every constant shown and labeled.

DSLR & mirrorless · 5 sensor formats · All formulas shown
Who this is for Photographers who want to understand — not just look up — how aperture, focal length, focus distance, and sensor size interact to create depth of field. The calculator works for any still-image camera system; video shooters should note that DoF norms differ when frame rate and motion blur are factors.

The calculator

Depth of field for your shot

Change any input and the results update instantly. Focus distance must be greater than the focal length.

In millimeters — the number printed on your lens (e.g. 50, 85, 24).

The f-stop you are shooting at — e.g. 1.8, 2.8, 5.6, 11.

In meters — the distance from your camera to the subject (e.g. 3 for a 3 m portrait).

Each format uses a different circle-of-confusion constant — see the table below.

The formulas, in full

These are the exact equations the calculator runs — the standard thin-lens DoF approximations used in optical engineering and photography references. Every variable is defined; every constant is labeled.

Variable definitions

What each symbol means

f — focal length, in millimeters (mm). The number printed on your lens.

N — the f-number (aperture). A dimensionless ratio of focal length to entrance pupil diameter.

s — subject distance (focus distance), in millimeters. Convert from meters: multiply by 1000.

c — circle of confusion (CoC) in millimeters. The maximum diameter of a blur spot that still reads as a point when the image is viewed at a normal distance. Depends on sensor size — see the CoC table below.

H — hyperfocal distance, in millimeters.

Dn — near limit of depth of field, in millimeters.

Df — far limit of depth of field, in millimeters. Infinity when H − s ≤ 0.

Equations

Hyperfocal distance H = f² / (N × c) + f

All lengths in mm. Focusing at H places the far limit of DoF at infinity and the near limit at H/2. This is the maximum-DoF focus point for a given focal length and aperture.

Near limit Dn = s(H − f) / (H + s − 2f)

The closest distance (in mm) from the camera that falls within the depth of field.

Far limit Df = s(H − f) / (H − s)

The farthest sharp distance (in mm). If H − s ≤ 0 (i.e., focus distance ≥ hyperfocal), the far limit is infinity — everything from Dn onward appears sharp.

Total depth of field DoF = Df − Dn

Infinity when the far limit is infinity. All outputs convert mm → meters for display.

Circle of confusion by sensor format

The CoC value is derived from the sensor's diagonal dimension divided by a conventional enlargement factor (typically ~1500, accounting for a standard print viewed at a normal distance). These are the industry-standard values used by the major DoF calculators and optical references.

Sensor format Crop factor Sensor diagonal (approx.) CoC (mm) — used by this calculator
Full frame (35 mm) 43.3 mm 0.029 mm
APS-C 1.5× (Nikon, Sony, Fuji) 1.5× 28.4 mm 0.019 mm
Canon APS-C 1.6× 1.6× 26.7 mm 0.018 mm
Micro Four Thirds 2× 21.6 mm 0.015 mm
1-inch sensor 2.7× 2.7× 15.9 mm 0.011 mm

CoC values are industry-standard constants derived from each sensor's diagonal. The calculator uses the CoC for the format you select — the active row is highlighted when a sensor format is chosen above.

Worked example — step by step

A 50 mm lens at f/1.8, focused at 3 meters on a full-frame camera. These are the calculator's default inputs; you can reproduce every figure below by hand.

Inputs

50 mm · f/1.8 · 3 m · Full frame

f = 50 mm  |  N = 1.8  |  s = 3 m = 3000 mm  |  c = 0.029 mm (full frame)

Step 1 — Hyperfocal distance H

H = f² / (N × c) + f
H = 50² / (1.8 × 0.029) + 50
H = 2500 / 0.0522 + 50
H = 47,892.7 + 50 = 47,942.7 mm ≈ 47.94 m

Step 2 — Near limit Dn

Dn = s(H − f) / (H + s − 2f)
Dn = 3000 × (47942.7 − 50) / (47942.7 + 3000 − 100)
Dn = 3000 × 47892.7 / 50842.7
Dn = 143,678,100 / 50842.7 = 2825.9 mm ≈ 2.83 m

Step 3 — Far limit Df

Check: H − s = 47942.7 − 3000 = 44942.7 (positive, so far limit is finite)
Df = s(H − f) / (H − s)
Df = 3000 × 47892.7 / 44942.7
Df = 143,678,100 / 44942.7 = 3196.9 mm ≈ 3.20 m

Step 4 — Total depth of field

DoF = Df − Dn
DoF = 3196.9 − 2825.9 = 371.0 mm ≈ 0.37 m

Step 5 — Interpret the result

At f/1.8, 50 mm, focused 3 m away on full frame, the depth of field is about 37 cm — from 2.83 m to 3.20 m. That is roughly 17 cm in front of the focus point and 20 cm behind it. Notice it is not an even one-third / two-thirds split: the split here is approximately 45% / 55% — the rule breaks down at non-intermediate distances. The hyperfocal distance of ~47.94 m is far beyond the focus point, so the far limit stays finite at 3.20 m.

Common mistakes with depth of field

DoF is frequently misunderstood — here are the errors that come up most often, each of which can mislead your shooting decisions.

Assuming CoC stays the same across sensor formats

The circle-of-confusion constant is not universal — it changes with sensor size. Copying a DoF figure calculated for full frame and applying it to your APS-C or Micro Four Thirds camera will give you wrong numbers. A full-frame shooter and an MFT shooter using the same physical focal length and aperture at the same subject distance will get different depths of field because the MFT sensor uses a smaller CoC threshold (0.015 mm vs. 0.029 mm). Always enter your actual sensor format.

Treating the one-third / two-thirds rule as universal

The idea that one-third of DoF falls in front of the focus point and two-thirds behind it is a rough approximation that only holds near a specific range of distances (roughly mid-distances between near-focus and hyperfocal). At close focus distances (macro, portrait), the split approaches 50/50. At distances near or beyond the hyperfocal distance, the far side extends to infinity while the near side is finite — there is no meaningful ratio at all. Use the near and far limits from the calculator rather than a rule of thumb.

Confusing focus distance units (meters vs. feet vs. millimeters)

The DoF formulas require all lengths in the same unit — typically millimeters. A common error is entering the subject distance in meters directly into the formula without converting (multiplying by 1000). The symptom is a near-limit that computes as a fraction of a millimeter instead of a real-world distance. This calculator handles the conversion automatically: enter meters in the field, and all internal math runs in millimeters.

Thinking a smaller f-number (wider aperture) always gives the same DoF for a given subject size

When you move closer to keep a subject the same size in the frame, the subject distance decreases — and shorter subject distances reduce DoF independently of aperture. Shooting a headshot at f/2.8 from 1 m gives far less DoF than shooting a full-length portrait at f/2.8 from 5 m, even though the aperture is identical. Use the calculator to check DoF at your actual subject distance rather than inferring from aperture alone.

Assuming depth of field is symmetric around the focus point

Depth of field is almost never equal on both sides of the focus point. It is symmetric only in the macro range (very close focus distances relative to focal length). In real shooting scenarios, the DoF behind the subject is always longer than the DoF in front — sometimes by a small margin, sometimes dramatically. The asymmetry grows as the focus distance increases toward the hyperfocal distance.

Frequently asked

Depth of field (DoF) is the range of distances in a scene that appear acceptably sharp in a photograph. It has a near limit — the closest point that looks sharp — and a far limit. Everything between those two distances falls within the depth of field. Shallow DoF (a narrow range) isolates subjects against blurred backgrounds; deep DoF (a wide range) keeps both near and distant elements sharp. DoF is controlled by aperture, focal length, focus distance, and sensor size — and this calculator gives you the exact near and far limits for any combination.
The circle of confusion (CoC) is the largest blur spot on the sensor that still reads as a sharp point when the image is printed and viewed at a normal distance. It is the threshold that defines "acceptably sharp." Larger sensors produce larger images before the blur becomes visible, so they tolerate a larger CoC in absolute millimeters. Smaller sensors need a tighter threshold. Full frame uses 0.029 mm; APS-C 1.5× uses 0.019 mm; Canon APS-C 1.6× uses 0.018 mm; Micro Four Thirds uses 0.015 mm; and 1-inch sensors use 0.011 mm. Using the wrong CoC for your sensor will shift every output value.
When shooting the same scene at the same field of view and the same aperture number, smaller sensors produce more DoF — but only because you need a shorter focal length on a smaller sensor to match the field of view, and shorter focal lengths give more DoF. If you compare the same physical focal length and aperture at the same focus distance, a smaller sensor actually shows slightly less DoF because its CoC threshold is smaller. Change the sensor format in the calculator while keeping everything else constant to see this directly.
Hyperfocal distance (H) is the focus distance at which DoF extends from H/2 all the way to infinity. Focusing at the hyperfocal distance gives you the maximum possible DoF at that aperture and focal length. It is most useful for landscape, architecture, and street photography where you want everything from a specific foreground distance to the horizon sharp. To use it: read the hyperfocal value from the calculator above, then set your lens to that focus distance. Everything from H/2 onward will appear sharp in the final image.
No — this is a simplification that only holds at specific conditions. It is approximately true at intermediate focus distances (somewhere between the near-focus and hyperfocal ranges), but it breaks down entirely at close focus distances (macro work, tight portraits) where DoF splits roughly 50/50, and at distances near the hyperfocal where the far DoF extends to infinity while the near side stays finite. The calculator computes the near and far limits separately so you always get the real values rather than a rule of thumb.
A smaller aperture opening (larger f-number, such as f/11 or f/16) narrows the cone of light entering the lens from any single point. Rays from out-of-focus distances converge to a smaller blur circle on the sensor, so more of the scene falls within the acceptable-sharpness threshold. The widest possible depth of field comes from combining a high f-number, a short focal length, and a far focus distance — ideally the hyperfocal distance. One practical limit: stopping down beyond about f/11–f/16 on full frame (or f/8 on Micro Four Thirds) begins to introduce diffraction softness, which is a separate optical limit from DoF.