Skip to main content

Macro Depth of Field (DoF) Calculatorv1.0.0

Computes macro DoF as 2Nc(1+m)/m² from f-number N, circle of confusion c, and magnification m. Effective aperture N(1+m), bellows factor (1+m)², and exposure compensation log₂((1+m)²) stops are derived from the same inputs; sensor preset picks c (full frame through medium format) or a custom CoC. Output distance switches between mm, cm, and inches, with an optional step-by-step view and a diffraction warning when effective aperture exceeds the sensor's limit.

Photography
Macro Photography
Optics
Reference

Documentation

Calculate the depth of field for macro and close-up photography where traditional depth of field formulas become inaccurate. At macro distances, the magnification ratio dominates the depth of field calculation rather than the subject distance. The macro-specific formula used here accounts for magnification, circle of confusion, and aperture to produce precise depth of field measurements for close-up work. Results also include the effective aperture after lens extension, the bellows factor for exposure compensation, and the exact number of stops of light lost to the increased lens-to-sensor distance.

Formula reference: Total DoF = 2 × N × c × (1 + m) / m², where N is the f-number, c is the circle of confusion in millimeters, and m is the magnification ratio. Effective Aperture = N × (1 + m). Bellows Factor = (1 + m)². Exposure compensation in stops = log₂((1 + m)²). Subject distance from the lens principal plane = f × (1 + 1 / m).

  • Select your Camera Sensor / Film Format from the dropdown to set the circle of confusion value used in the calculation. Choose "Custom Circle of Confusion" if your sensor is not listed and enter the value in millimeters.
  • Enter the Focal Length of your lens in millimeters. For dedicated macro lenses, common values are 60, 90, 100, or 105 mm.
  • Enter the Aperture as an f-stop number. Fractions such as 5 1/2 and decimals such as 5.6 are both accepted. Stopping down increases depth of field but also increases diffraction effects at macro distances.
  • Enter the Magnification Ratio. A value of 1 represents life size (1:1), meaning the subject appears on the sensor at its actual size. A value of 0.5 is half life size (1:2), and 2 is twice life size (2:1). Most dedicated macro lenses reach at least 1:1 magnification, and extension tubes or bellows can push beyond 1:1.
  • Open Settings to change the output distance unit between millimeters, centimeters, or inches. Enable Show step-by-step formulas to see the full mathematical derivation. Enable the diffraction warning to be alerted when the effective aperture exceeds the diffraction limit for your sensor.
  • Results update automatically as you type, or press Calculate to recompute manually. Press Reset to restore all defaults and clear saved state.

Macro photography presents unique challenges because the depth of field at close focusing distances is extremely shallow, often measured in fractions of a millimeter. Knowing the exact depth of field helps photographers plan focus stacking sequences, choose optimal apertures, and understand the exposure compensation required when working at high magnification ratios.

  • Product Photography: Calculate the depth of field when shooting small items such as jewelry, watch mechanisms, or electronic components at 1:1 magnification to determine how many focus-stacked frames are needed to achieve full sharpness across the subject.
  • Nature and Insect Photography: Determine the usable depth of field when photographing insects, flowers, or textures in the field. Knowing that at 1:1 and f/8 the total depth of field is only about 1 mm helps set realistic expectations for sharpness.
  • Scientific and Medical Imaging: Compute precise depth of field for microscopy adapters, specimen photography, or forensic documentation where measurement accuracy and repeatable results are essential.
  • Focus Stacking Planning: Divide the total subject depth by the calculated depth of field to estimate the number of exposures needed for a complete focus stack. Adjust aperture to balance diffraction softening against the number of required frames.
  • Extension Tube and Bellows Users: Calculate the effective magnification and resulting depth of field when adding extension tubes or bellows to non-macro lenses. The bellows factor output reports exactly how much additional exposure is needed.
  • Education and Learning: Visualize how magnification, aperture, and sensor size interact to produce depth of field at macro distances. The step-by-step derivation shows every formula and substitution for learning purposes.
Inputs, outputs, and what the Macro 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: 100
  • Aperture (f-stop) (text input) · default: 8
  • Magnification Ratio (m) (text input) · default: 1
  • Output Distance Unit · default: millimeters (mm)
  • Show step-by-step formulas
  • Include diffraction-limited effective aperture warning

Controls

Calculate · Reset

Worked example

Calculate the depth of field for macro and close-up photography where traditional depth of field formulas become inaccurate.