Depth of Field Calculator
Calculate the depth of field (DOF), near and far sharp limits, and hyperfocal distance for any lens, aperture, and camera sensor. Enter your focal length, aperture f-stop, and focus distance to instantly see the full sharp zone in your photo.
H = f² / (N × c) + f | Near = s(H−f) / (H+s−2f) | Far = s(H−f) / (H−s)
Related Calculators
Frequently Asked Questions
What is depth of field in photography?
Depth of field (DOF) is the range of distances in a photo that appear acceptably sharp. When you focus at a specific distance, objects slightly in front of and behind that point also appear sharp. The size of this sharp zone is the depth of field. Shallow DOF means only a thin plane is sharp (common in portraits), while deep DOF means a large range is sharp (common in landscapes).
How does aperture affect depth of field?
Aperture has the most dramatic effect on DOF. A wide aperture (small f-number like f/1.4 or f/2.8) creates a shallow depth of field with strong background blur (bokeh). A narrow aperture (large f-number like f/11 or f/16) creates a deep depth of field where objects near and far are both sharp. Closing the aperture by one stop (e.g., from f/2.8 to f/4) roughly doubles the depth of field.
What is hyperfocal distance?
Hyperfocal distance is the closest focus distance at which objects at infinity are still acceptably sharp. When you focus at the hyperfocal distance, everything from half the hyperfocal distance to infinity will be in focus — giving you the maximum possible depth of field for a given aperture and focal length. It is the optimal focus point for landscape photography.
How does focal length affect depth of field?
Longer focal lengths (telephoto lenses) produce shallower depth of field than shorter focal lengths (wide-angle lenses) when focused at the same distance. A 200mm lens at f/5.6 will have much less DOF than a 24mm lens at f/5.6 when both are focused at the same distance. However, if you adjust focus distance to keep the subject the same size in the frame, the difference is less pronounced.
Does sensor size affect depth of field?
Yes, sensor size indirectly affects DOF through the circle of confusion (CoC) value used in calculations. Full-frame cameras use CoC = 0.030mm, APS-C uses ~0.020mm, and Micro 4/3 uses ~0.015mm. At identical focal length, aperture, and focus distance, a full-frame sensor gives more DOF due to its larger CoC. However, to capture the same framing, you need longer focal lengths on larger sensors, which counteracts this effect.
What is the circle of confusion?
The circle of confusion (CoC) is the maximum size of a blur spot that appears as a sharp point to the human eye when viewing a print at a standard viewing distance (typically 25cm). It determines the sharpness threshold used in DOF calculations. The standard value for full-frame is 0.030mm, APS-C is 0.020mm, and Micro 4/3 is 0.015mm. Smaller CoC values result in shallower calculated DOF.
How do I use the hyperfocal distance for landscape photography?
To maximize depth of field in landscape photography: 1) Enter your lens's focal length and chosen aperture into the calculator. 2) Note the hyperfocal distance shown. 3) Set your focus to that distance (use distance scale on lens or focus peaking). 4) Everything from half the hyperfocal distance to infinity will be in focus. For example, a 24mm lens at f/8 on a full frame has a hyperfocal distance of about 2.4m — focus there and everything from 1.2m to infinity is sharp.
Why does DOF go to infinity in the calculator?
When your focus distance equals or exceeds the hyperfocal distance, the far limit of the depth of field extends to infinity. This means everything beyond your near limit will appear sharp all the way to the horizon. This commonly occurs with wide-angle lenses at small apertures (high f-numbers) like f/11 or f/16, or when photographing distant subjects. The calculator shows '∞' for the far limit and total DOF in this case.
What is Depth of Field?
Depth of field (DOF) is the range of distances in a photograph that appear acceptably sharp. When you focus your camera at a specific distance, objects close to that point — both in front and behind — will also appear sharp, while objects farther from the focus point will be blurred.
DOF is not a binary sharp/blurry boundary. Rather, sharpness gradually decreases as distance from the focus point increases. The “acceptable” sharpness threshold is defined by the circle of confusion (CoC) — the maximum size of a blur spot that the human eye perceives as a point when viewing a print at a standard viewing distance.
Three main factors control depth of field: aperture (f-stop), focal length, and focus distance. Sensor size indirectly affects DOF through the circle of confusion value.
Depth of Field Formula
The standard DOF calculation uses the hyperfocal distance as an intermediate value. Here are the exact formulas used by this calculator:
Hyperfocal Distance (H):
H = f² / (N × c) + f
where f = focal length (mm), N = f-stop number, c = circle of confusion (mm)
Near Limit:
Dnear= s(H − f) / (H + s − 2f)
Far Limit:
Dfar= s(H − f) / (H − s) [∞ when s ≥ H]
Total Depth of Field:
DOF = Dfar − Dnear
The variable s is the focus distance in millimeters. All units must be consistent — the calculator converts meters to millimeters internally and returns results in meters for readability.
Aperture and Depth of Field Relationship
Aperture (expressed as an f-stop or f-number) has the most dramatic effect on depth of field. A wider aperture (smaller f-number like f/1.4) produces a shallower DOF, while a narrower aperture (larger f-number like f/16) produces a deeper DOF.
| Aperture | DOF Effect | Common Use |
|---|---|---|
| f/1.4 – f/2.8 | Very shallow | Portrait, low-light, artistic blur |
| f/4 – f/5.6 | Moderate | General photography, street |
| f/8 – f/11 | Deep | Landscape, architecture, group shots |
| f/16 – f/22 | Very deep | Macro, technical photography |
Note that very small apertures (f/16 and beyond) introduce diffraction, which can reduce sharpness across the entire frame. Most lenses perform best between f/5.6 and f/11 for overall sharpness.
Hyperfocal Distance
The hyperfocal distanceis the closest focus distance at which objects at infinity are still acceptably sharp. It is the “sweet spot” for landscape and street photography where you want everything from a near point to infinity in focus.
When you focus at the hyperfocal distance:
- Everything from half the hyperfocal distance to infinity is in focus.
- The far limit extends to infinity.
- You achieve the maximum possible depth of field for a given aperture and focal length.
Example: 24mm lens at f/8 (full frame):
H = 24² / (8 × 0.030) + 24
H = 576 / 0.24 + 24
H = 2400 + 24 = 2424 mm ≈ 2.42 m
Focus at 2.42 m → sharp from 1.21 m to ∞
A shorter focal length or smaller aperture results in a shorter hyperfocal distance, making it easier to get everything sharp. This is why wide-angle lenses are preferred for landscape photography.
How Sensor Size Affects Depth of Field
Sensor size affects DOF indirectly through the circle of confusion (CoC)value. A larger sensor has a larger maximum acceptable blur spot, which paradoxically results in a shallower depth of field at the same field of view and aperture — because a larger sensor requires a longer focal length to achieve the same framing.
| Sensor Format | Typical CoC | Crop Factor | DOF vs Full Frame |
|---|---|---|---|
| Full Frame (35mm) | 0.030 mm | 1.0× | Reference |
| APS-C (Canon/Nikon) | 0.020 mm | 1.5–1.6× | ~1.5× deeper |
| Micro 4/3 | 0.015 mm | 2.0× | ~2× deeper |
When comparing cameras, use the equivalent aperture (multiply f-stop by crop factor) to get the same DOF effect. For example, f/2.8 on a Micro 4/3 camera gives the same DOF as approximately f/5.6 on a full-frame camera with the same framing.
Depth of Field Calculation Examples
Example 1: Portrait Photography (85mm f/1.8 at 2m)
A portrait photographer uses an 85mm lens at f/1.8 focused at 2 meters on a full-frame camera.
H = 85² / (1.8 × 0.030) + 85 = 7225 / 0.054 + 85 ≈ 133,796 mm ≈ 133.8 m
Near = 2000(133796 − 85) / (133796 + 2000 − 170) ≈ 1972 mm ≈ 1.97 m
Far = 2000(133796 − 85) / (133796 − 2000) ≈ 2029 mm ≈ 2.03 m
Total DOF ≈ 6 cm — very shallow, ideal for subject separation
Example 2: Landscape Photography (24mm f/8 at hyperfocal)
A landscape photographer uses a 24mm lens at f/8 on a full-frame camera, focused at the hyperfocal distance of approximately 2.4 meters.
H ≈ 2424 mm ≈ 2.42 m
Near ≈ H/2 = 1.21 m
Far = ∞
Everything from 1.21 m to infinity is in sharp focus.
Example 3: APS-C vs Full Frame at Same Settings
Compare a 50mm f/2.8 at 3m on full frame vs APS-C:
Full Frame (CoC=0.030): Near ≈ 2.77 m, Far ≈ 3.27 m, DOF ≈ 50 cm
APS-C (CoC=0.020): Near ≈ 2.84 m, Far ≈ 3.19 m, DOF ≈ 35 cm
APS-C gives ~30% shallower DOF at identical settings (but frames differently).