Depth of Field Calculator
Enter your camera sensor size, focal length, aperture (f-stop), and focus distance to instantly calculate the depth of field (DoF), near and far sharp limits, and hyperfocal distance. Switch between metric and imperial units. Results update in real time as you adjust any value.
Formula
Worked example
A 50 mm lens at f/2.8 on a full-frame body (CoC = 0.030 mm) focused at 3 m: H = 0.050 + 0.050² / (2.8 × 0.000030) = 0.050 + 0.0025 / 0.000084 = 0.050 + 29.76 ≈ 29.81 m. Dn = 29.81 × 3 / (29.81 + 3 - 0.05) ≈ 2.72 m. Df = 29.81 × 3 / (29.81 - 3 + 0.05) ≈ 3.33 m. Total DoF ≈ 0.61 m.
What is depth of field?
Depth of field (DoF) is the range of distances in a scene that appear acceptably sharp in a photograph. Only the plane at the exact focus distance is truly in focus; everything in front of and behind it gradually blurs. DoF describes the zone over which that blur is small enough that the human eye perceives the image as sharp when viewed at a standard print size and distance. Photographers use a shallow depth of field to isolate a subject from a soft, blurred background (bokeh), or a deep depth of field to keep everything sharp from foreground to horizon in landscapes and architecture.
What controls depth of field?
Three lens settings and one physical property govern how deep or shallow your DoF is. Aperture is the strongest lever: opening up from f/8 to f/2.8 roughly halves the DoF at the same focal length and distance. Focal length matters because a longer lens focused at the same subject distance and framing produces shallower DoF than a wide-angle. Focus distance also scales DoF, because getting closer to your subject dramatically shrinks the sharp zone. Sensor size sets the circle of confusion (CoC), the largest acceptable blur spot diameter. Larger sensors like full-frame have a larger CoC than small compact sensors, which means they produce shallower DoF at the same field of view.
Hyperfocal distance and how to use it
The hyperfocal distance is the closest focus point that still keeps the far limit of sharpness at infinity. When you focus exactly at the hyperfocal distance, everything from half that distance to infinity appears acceptably sharp. This makes it a favourite technique for landscape photographers who need maximum front-to-back sharpness: focus at the hyperfocal distance, stop down to f/8 or f/11, and everything from the foreground detail to the distant hills will be sharp. The hyperfocal distance shortens as you stop down (smaller aperture number), and it also shortens with wider focal lengths. A 24 mm lens at f/11 on full-frame has a hyperfocal distance of roughly 1.8 m, meaning everything from about 0.9 m to infinity is sharp.
Circle of confusion and sensor size
The circle of confusion (CoC) is the maximum diameter of a blur spot that still looks like a point to a human eye in a standard print. It is typically calculated as the sensor diagonal divided by 1500. A 35 mm full-frame sensor has a diagonal of about 43 mm, giving a CoC of about 0.030 mm. A Micro Four Thirds sensor has a diagonal of about 22 mm and a CoC of about 0.015 mm. Because smaller sensors have tighter CoC tolerances, they produce more depth of field than full-frame at the same aperture and subject distance. To match the same DoF and field of view as a full-frame camera, a Micro Four Thirds shooter must open the aperture two full stops.
Typical depth of field for common shooting scenarios
| Scenario | Focal length | Aperture | Approx. DoF |
|---|---|---|---|
| Environmental portrait | 85 mm | f/4.0 | ~0.9 m |
| Tight headshot (bokeh) | 85 mm | f/1.8 | ~0.2 m |
| Street / documentary | 35 mm | f/8.0 | ~4.5 m |
| Landscape (near-infinity) | 24 mm | f/11 | Very deep |
| Studio product | 100 mm | f/16 | ~0.8 m |
| Macro (1:1 at 0.3 m) | 100 mm | f/11 | ~2 mm |
Approximate DoF on a 35 mm full-frame body at a 3 m subject distance.
Frequently asked questions
How do I get a blurry background (bokeh)?
Use a wide aperture (low f-number such as f/1.4, f/1.8, or f/2.8), a longer focal length (85 mm or more for portraits), get close to your subject, and keep the background as far behind the subject as possible. Each of these choices reduces depth of field and increases background blur. Sensor size also plays a role: larger sensors (full-frame or medium format) produce shallower DoF than cropped sensors at equivalent field-of-view settings.
What is the difference between near and far limits?
The near limit is the closest distance from the camera at which the scene still appears acceptably sharp. The far limit is the furthest distance that still appears sharp. The total depth of field is the far limit minus the near limit. Because depth of field is not symmetrical around the focus point, more of the DoF usually extends behind the subject than in front of it, especially at longer distances.
Why does the far limit show as infinity?
When you focus at or beyond the hyperfocal distance, the far limit of sharpness extends to infinity. The hyperfocal distance is the shortest focus distance at which infinity is still within the sharp zone. This happens because the optical formula for the far limit has zero in the denominator when the focus distance equals the hyperfocal distance, making the result approach infinity.
Does sensor size affect depth of field?
Yes, significantly. Larger sensors have a larger circle of confusion and therefore produce shallower depth of field at the same aperture, focal length, and focus distance. However, photographers often compare cameras at the same field of view, which means using a longer lens on a larger sensor. When you account for equivalent focal length and aperture to achieve the same framing and exposure, a full-frame camera produces roughly 2x shallower DoF than a Micro Four Thirds camera.
What is a circle of confusion?
The circle of confusion (CoC) is the maximum diameter of a blur spot that a human eye cannot distinguish from a sharp point when viewing a standard-size print at a normal viewing distance. It is the key variable linking the optical mathematics of lenses to perceptible sharpness. The standard formula is CoC = sensor diagonal / 1500. Photographers who print very large or view images at 100% pixel-peeping zoom may prefer a stricter (smaller) CoC value.