Skip to main content

Macro Depth of Field (DoF) Calculator

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.

Runs entirely in your browser

This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.

Design
Macro Photography
Optics
Loading the tool
Reference

Documentation

Depth of field in macro and close-up photography behaves differently from ordinary shooting distances, where the standard formulas become inaccurate. At macro distances the magnification ratio dominates the depth of field calculation rather than the subject distance, so a macro-specific formula 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).

At 1:1 magnification (m = 1) and f/8 (N = 8) with a circle of confusion of 0.03mm, Total DoF = 2 × 8 × 0.03 × (1 + 1) / 1² = 0.96mm, under a millimeter, which is why focus stacking becomes necessary at true macro magnifications. The same settings give an Effective Aperture of 8 × (1 + 1) = 16, so the lens transmits light and resolves detail as though it were set to f/16, and a Bellows Factor of (1 + 1)² = 4, which is 2 stops of exposure compensation since log₂(4) = 2.

  • Sensor or film format presets set the circle of confusion value used in the calculation; a custom circle of confusion covers any unlisted sensor.
  • Focal length is entered in millimeters; for dedicated macro lenses, common values are 60, 90, 100, or 105 mm.
  • Aperture is entered as an f-stop number, accepting fractions such as 5 1/2 and decimals such as 5.6. Stopping down increases depth of field but also increases diffraction effects at macro distances.
  • Magnification ratio expresses how large the subject appears on the sensor relative to life size: a value of 1 is life size (1:1), 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, and extension tubes or bellows can push beyond it.
  • Settings hold the output distance unit (millimeters, centimeters, or inches), a step-by-step formula derivation, and a diffraction warning that flags when the effective aperture exceeds the diffraction limit for the sensor.

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. At 1:1 and f/8, the total depth of field is only about 1 mm, which sets 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: Dividing the total subject depth by the calculated depth of field estimates the number of exposures needed for a complete focus stack. Adjusting aperture balances 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

What the Macro Depth of Field (DoF) Calculator asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

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 · default: off
  • Include diffraction-limited effective aperture warning · default: off

Controls

Calculate · Reset

Example

At 1:1 magnification (m = 1) and f/8 (N = 8) with a circle of confusion of 0.03mm, Total DoF = 2 × 8 × 0.03 × (1 + 1) / 1² = 0.96mm, under a millimeter, which is why focus stacking becomes necessary at true macro magnifications.