Depth of Field (DoF) Calculatorv1.0.0
Hyperfocal distance, near and far focus limits, and total depth of field from focal length, aperture, subject distance, and circle of confusion. Sensor format presets supply the CoC (Full Frame 0.043 mm, APS-C 0.029 to 0.030 mm, Micro Four Thirds 0.022 mm, 1-inch 0.019 mm, smartphone 1/2.3-inch 0.006 mm, medium format up to 0.072 mm), with a custom CoC field and selectable subject-distance units (feet, meters, inches, or centimeters).
Documentation
Calculate depth of field (DoF), the zone of acceptable sharpness in front of and behind the point of focus. The result depends on camera sensor size, lens focal length, aperture, and subject distance, and the calculation also returns hyperfocal distance and the split between near and far sharpness.
- Select the Camera Sensor / Film Format from the dropdown. Full Frame, APS-C variants, Micro Four Thirds, several compact sensors, and medium format are listed. Choose Custom Circle of Confusion for unlisted sensors and enter the CoC in millimeters.
- Enter the Focal Length in millimeters as printed on the lens (50 for a 50mm prime, 200 for a 200mm telephoto). Fractions like 1/2 and mixed numbers are accepted.
- Enter the Aperture as an f-stop number. Wider apertures (smaller numbers) shrink the depth of field. Narrower apertures (larger numbers) expand the zone of sharpness.
- Enter the Subject Distance and choose feet, meters, inches, or centimeters. This is the distance from the camera sensor to the subject.
- Results update automatically as fields change, or click Calculate to refresh. Output includes near focus limit, far focus limit, total depth of field, hyperfocal distance, and the percentage of the DoF in front of versus behind the subject.
- Open Advanced Settings to toggle step-by-step formulas, change the output distance unit, or adjust decimal precision.
- Click Reset to restore all settings to their defaults and clear saved state.
The hyperfocal distance is H = f² / (N × c) + f, where f is focal length, N is the f-number, and c is the circle of confusion. The near limit is Dn = s × (H - f) / (H + s - 2f). The far limit is Df = s × (H - f) / (H - s) when s is less than H, otherwise the far limit extends to infinity.
Plan focus zones across portraits, landscapes, macro, and motion work. Knowing the precise boundaries of acceptable sharpness reduces wasted frames and supports deliberate creative choices about aperture, focus point, and composition.
- Portrait Photography: Check whether an 85mm lens at f/1.8 focused at 8 feet keeps both eyes sharp while blurring the background. Compare results at f/2.8 to decide if stopping down is needed for group portraits.
- Landscape Photography: Determine the hyperfocal distance for a 24mm lens at f/11 to maximize sharpness from foreground to distant mountains. Use the near limit value to verify close objects fall within the focus zone.
- Macro Photography: Evaluate depth of field at very close focus distances where the sharp zone shrinks to fractions of an inch. Plan focus stacking sequences by calculating focus plane shifts between shots.
- Product Photography: Confirm that an entire product fits within the depth of field at close range. Compare aperture settings to find the minimum f-stop that keeps the full object sharp without diffraction softening.
- Astrophotography: Verify that a wide-angle lens focused at the hyperfocal distance renders stars as points rather than blurs. Compare aperture settings to balance light gathering with depth of field.
- Cinematography: Plan focus pulls by computing the near and far limits at each marked distance. Know exactly when a subject walks into or out of the acceptable focus zone during tracking shots.
- Education: Visualize how changing one variable (aperture, focal length, distance, or sensor size) affects the depth of field. Enable step-by-step formulas to reinforce the math behind photographic optics.
Inputs, outputs, and what the Depth of Field (DoF) Calculator computes
The form above accepts the following inputs and produces the outputs listed below. This summary is rendered in the page so the parameters are visible to crawlers, assistive tech, and indexing agents that don't fetch the embedded tool frame.
Inputs
- Camera Sensor / Film Format · default: Full Frame (35mm)
- Custom Circle of Confusion (mm) (text input) · default: 0.029
- Focal Length (mm) (text input) · default: 50
- Aperture (f-stop) (text input) · default: 2.8
- Subject Distance (text input) · default: 10
- Distance unit · default: feet
- Show step-by-step formulas
- Output Distance Unit · default: feet
- Decimal Places (numeric input) · default: 2 · range: 0 to 6
Controls
Calculate · Reset
Worked example
Enter the Focal Length in millimeters as printed on the lens (50 for a 50mm prime, 200 for a 200mm telephoto).