Depth Of Field Calculator - Lens, Aperture, Focus Distance, and Sensor Size

Depth of field calculator that returns near, far, and total focus limits plus the hyperfocal distance for any focal length, aperture, and focus distance.

Updated: June 19, 2026 • Free Tool

Depth Of Field Calculator

The lens focal length in millimetres. Defaults to 50mm, the classic 'normal' lens on full frame.

The lens aperture as an f-number. Wider apertures (smaller f-numbers) give shallower depth of field.

The focus distance to the main subject, in the selected unit. Defaults to 5 metres.

Pick a preset to fill the circle of confusion for the chosen sensor format.

Unit for the subject distance and all focus outputs.

Results

Near Focus Distance
0
Far Focus Distance 0
Total Depth of Field 0
Hyperfocal Distance 0
Far Limit 0
Distance Unit 0

What Is Depth Of Field Calculator?

A depth of field calculator turns focal length, aperture, focus distance, and sensor size into the near focus limit, the far focus limit, the total depth of field, and the hyperfocal distance, so a photographer can read the focus range for any lens and body combination.

  • Pick an aperture for landscape sharpness: Set a wide-angle focal length and a near focus point, then vary the aperture until the far distance reads infinity, so the scene from foreground to horizon is sharp.
  • Read portrait background blur: Pick a 50mm or 85mm lens at f/1.8, set the focus distance, and read the total depth of field to know how much of the face stays sharp.
  • Plan focus stacking for macro work: Use a macro lens at a small focus distance and read the near and far limits for several apertures to decide how many stacked frames are needed.
  • Choose a focus distance for street photography: Set a 35mm lens at f/8 and a typical street focus distance such as 3 m, then read the total depth of field to know whether a passing subject stays in focus.

Depth of field depends on focal length, aperture, focus distance, and the sensor format that sets the circle of confusion. The calculator combines all four inputs in the standard lensmaker equations, replacing the lookup tables that older photography manuals printed in the back pages.

Because the depth of field math scales with the circle of confusion, and the circle of confusion scales with the sensor size, the Crop Factor Calculator is the natural pair when a reader wants to compare a 35mm full frame body against an APS-C body before using this calculator.

How Depth Of Field Calculator Works

The model is the standard lensmaker equation used by every depth of field reference: hyperfocal distance from focal length, aperture, and circle of confusion, then near and far focus limits from the hyperfocal distance and the chosen focus distance.

H = f^2 / (N * c) + f; D_near = s * (H - f) / (H + s - 2f); D_far = s * (H - f) / (H - s) when s < H, else infinity; DoF = D_far - D_near
  • Focal length f in mm: The lens focal length in millimetres. Longer focal lengths give shallower depth of field at the same aperture and focus distance.
  • Aperture N as an f-number: The lens aperture as an f-number (for example f/1.4, f/2.8, f/8). Smaller f-numbers mean wider apertures and shallower depth of field.
  • Circle of confusion c in mm: Maximum acceptable blur circle on the sensor. Defaults to 0.030 mm for full frame and scales down for smaller sensors through the preset menu.
  • Subject distance s: The focus distance to the main subject in the selected unit. The calculator converts to metres internally and returns near, far, hyperfocal, and total depth of field in the same unit.

Focus at H and the far distance becomes infinity, so anything from H/2 to the horizon stays sharp. Landscape shooters pick the widest aperture that still gives infinity at the chosen focus point.

50mm f/8 on full frame focused at 5 m

Focal length 50 mm, aperture f/8, CoC 0.030 mm, subject distance 5 m

H = 50^2 / (8 * 0.030) + 50 = 10.47 m. Near = 5000 * 10416.67 / 15366.67 = 3389 mm. Far = 5000 * 10416.67 / 5466.67 = 9527 mm.

Near 3.39 m, far 9.53 m, total 6.14 m, hyperfocal 10.47 m.

A 50mm f/8 lens focused at 5 m on full frame keeps subjects sharp from 3.39 m to 9.53 m. The far distance is short of infinity, so the background falls out of focus.

According to Wikipedia, the standard lensmaker equations give the near focus distance as s*(H-f)/(H+s-2f), the far focus distance as s*(H-f)/(H-s), and the hyperfocal distance as f^2/(N*c) plus f.

When a depth of field spec sheet lists the focus distance in centimetres or inches and the calculator expects metres or feet, the Length Converter converts the value in one step before the lensmaker equations run.

Key Concepts Explained

Four ideas show up every time depth of field is mentioned. Understanding them keeps the result grounded in what the lens and sensor do.

Hyperfocal distance

The closest focus distance that keeps the far limit at infinity for a given focal length, aperture, and circle of confusion. Focusing at H or further turns the entire background sharp.

Circle of confusion

The maximum acceptable blur circle on the sensor, set by the sensor size preset. Full frame is 0.030 mm, APS-C is about 0.019 to 0.020 mm, and 1/2.3 inch compacts are about 0.005 mm.

Near and far focus limits

The closest and farthest subject distances that stay acceptably sharp at the chosen focus point. The far limit becomes infinity at the hyperfocal distance.

Equivalent depth of field and crop factor

A 50mm f/8 lens on a 1.5x APS-C body gives the same depth of field as a 75mm f/12 lens on full frame, because the crop factor scales the equivalent aperture for depth of field in the same way it scales the focal length.

When a sensor spec sheet lists the circle of confusion in fractional inches and the depth of field calculator expects millimetres, the Metric to Inches Calculator converts the value before the preset menu runs.

How to Use This Calculator

The form follows the way a photographer plans a shot: pick the sensor size, type the focal length and aperture, then read the near and far focus limits.

  1. 1 Pick the sensor size preset: Choose the preset that matches the camera body. The preset fills the standard circle of confusion, which controls how much blur counts as 'in focus' for that sensor.
  2. 2 Enter the focal length and aperture: Type the lens focal length in millimetres and the aperture as an f-number. Both feed the hyperfocal distance equation along with the circle of confusion.
  3. 3 Enter the subject distance: Type the focus distance to the main subject, then pick metres or feet from the Distance Unit menu. The calculator converts to metres internally and returns near, far, hyperfocal, and total depth of field in the same unit.
  4. 4 Read the near, far, and total depth of field: The primary result shows the near focus distance and the far focus distance, with the total depth of field underneath. A 'Far Limit: Infinity' label means the focus distance is at or beyond the hyperfocal distance and the background is sharp.

A landscape photographer wants a 24mm lens on full frame focused at 3 m. They pick the 35mm full frame preset so the circle of confusion is 0.030 mm, type 24 in the focal length box, type 11 in the aperture box, and type 3 in the subject distance box. The calculator shows a hyperfocal distance of 1.77 m, a near limit of 1.11 m, a far limit of infinity, and a total depth of field of infinity, so foreground and horizon are both sharp.

When a depth of field reference lists the focus distance in feet and the photographer's lens markings are in metres, the Meters to Feet Calculator converts the value before the lensmaker equations run.

Benefits of Using This Calculator

The depth of field calculator replaces printed depth of field tables and rough thumb rules photographers used to keep in their heads, with a single form that runs the lensmaker equations on any focal length, aperture, focus distance, and sensor format.

  • Near, far, hyperfocal, and total in one panel: Read the near focus distance, the far focus distance, the hyperfocal distance, and the total depth of field in the same panel, so a photographer can plan a shot without switching references.
  • Sensor size presets fill the circle of confusion: Pick full frame, Canon APS-C, Nikon or Sony APS-C, Micro Four Thirds, 1 inch, 1/2.3 inch compact, or Medium Format 645 and the calculator fills the standard circle of confusion for that sensor.
  • Metric and imperial inputs accepted: Switch the Distance Unit menu between metres and feet, so a single form handles European spec sheets and US spec sheets without a separate conversion step.
  • Infinity flag for landscape shooters: A 'Far Limit: Infinity' label appears whenever the focus distance reaches the hyperfocal distance, so landscape photographers know the entire background is sharp.

Once the depth of field limits and the focus distance are on screen, the Time Lapse Calculator turns the same lens and focus data into the interval, total runtime, and frame count for a time-lapse shoot.

Factors That Affect Your Results

Several real-world variables change the depth of field even when the lens and aperture are the same. Knowing them explains why two cameras with the same label can give different focus ranges.

Aperture and depth of field

Wider apertures give shallower depth of field at the same focal length and focus distance. Going from f/8 to f/1.8 at 50mm and 5 m drops the total depth of field from about 6 m to about 13 cm on full frame.

Focal length and depth of field

Longer focal lengths give shallower depth of field at the same aperture and focus distance. A 200mm lens at f/4 focused at 5 m gives a shallower range than a 24mm lens at the same settings.

Sensor size and equivalent depth of field

Smaller sensors use a smaller circle of confusion and give more depth of field at the same field of view. A 50mm f/8 lens on a 2x MFT body matches a 100mm f/16 lens on full frame for depth of field.

  • The lensmaker equations assume a thin lens and ignore diffraction, so at very small apertures such as f/22 the actual depth of field may stop increasing.
  • The circle of confusion is a perceptual standard, not a physical constant. Different reference prints suggest different CoC values, so photographers who print large should pick a slightly smaller CoC.

According to Wikipedia, the hyperfocal distance scales with focal length squared, scales inversely with the aperture and the circle of confusion, and is the focus distance at which the far limit becomes infinity.

Once the depth of field and focus range are on screen, the Data Storage Converter turns the chosen image file size and the planned frame count into a raw storage budget, so a photographer knows how many frames will fit on a memory card.

Depth of field calculator showing near focus distance, far focus distance, total depth of field, and hyperfocal distance for any focal length, aperture, sensor size, and focus distance
Depth of field calculator showing near focus distance, far focus distance, total depth of field, and hyperfocal distance for any focal length, aperture, sensor size, and focus distance

Frequently Asked Questions

Q: What is depth of field in photography?

A: Depth of field is the range of subject distances that look acceptably sharp in a photograph. It is set by the lens focal length, the lens aperture, the focus distance to the main subject, and the sensor size, which together determine the circle of confusion.

Q: How do you calculate depth of field?

A: Use the standard lensmaker equations. The hyperfocal distance is f squared divided by N times c plus f. The near focus limit is s times (H minus f) divided by (H plus s minus 2f). The far focus limit is s times (H minus f) divided by (H minus s), or infinity when s is at or past H.

Q: What is the hyperfocal distance?

A: The hyperfocal distance is the closest focus distance that keeps the far limit at infinity for a given focal length, aperture, and circle of confusion. For a 50mm lens at f/8 on full frame the hyperfocal distance is about 10.47 m, so focusing at 10.47 m or further turns the entire background sharp.

Q: How does aperture affect depth of field?

A: Wider apertures (smaller f-numbers) give shallower depth of field at the same focal length and focus distance. Going from f/8 to f/1.8 at 50mm and 5 m on full frame drops the total depth of field from about 6 m to about 13 cm.

Q: What circle of confusion should I use for depth of field?

A: Use 0.030 mm for 35mm full frame, about 0.019 to 0.020 mm for APS-C, about 0.015 mm for Micro Four Thirds, about 0.011 mm for 1 inch sensors, and about 0.045 mm for medium format. The sensor preset in this calculator fills the standard value automatically.

Q: Why does depth of field change with sensor size?

A: A smaller sensor uses a smaller circle of confusion, so the lensmaker equations give a narrower focus range for the same focal length, aperture, and focus distance. To match depth of field at the same field of view, both focal length and aperture must be scaled by the crop factor, which is why a 50mm f/8 lens on a 2x Micro Four Thirds body matches a 100mm f/16 lens on full frame.