Plan your future with our Retirement Budget Calculator

Depth of Field (DoF) Calculator

Enter your focal length, aperture, subject distance and sensor format to calculate depth of field, hyperfocal distance, focus limits and background blur.
Loading...
Luis GonzalezCreated by Luis GonzalezLast updated:

How to Use This Calculator

  1. 1

    Enter Focal Length

    Input the focal length of your lens in millimeters (e.g., 50mm). This is typically printed on the lens itself.

  2. 2

    Specify Aperture (f-number)

    Provide the f-stop aperture setting (e.g., f/2.8). Lower f-numbers create shallower depth of field.

  3. 3

    Input Subject Distance

    Enter the distance from your camera's sensor plane to your main subject in meters.

  4. 4

    Set Circle of Confusion (CoC)

    Choose a CoC value, which represents the maximum acceptable blur spot diameter on the sensor. Common values are 0.030 mm for full frame or 0.020 mm for APS-C, or select a sensor format preset.

  5. 5

    Select Sensor Format (Optional)

    Choose your camera's sensor format to automatically populate a typical Circle of Confusion value, or select 'Custom' for manual input.

  6. 6

    Review DoF and Focus Limits

    The calculator will display the total depth of field, near and far focus limits, hyperfocal distance, and bokeh intensity.

Example Calculation

A portrait photographer wants to achieve a shallow depth of field with a 50mm lens at f/2.8 on a full-frame camera, with the subject 3 meters away.

Focal Length

50 mm

Aperture (f-number)

f/2.8

Subject Distance

3 m

Circle of Confusion

0.030 mm

Sensor Format

Full Frame (35mm)

Results

3.236 m

Tips

Wider Aperture, Shallower DoF

To achieve a very shallow depth of field (for bokeh or subject isolation), use a lens with a wide aperture (low f-number) like f/1.4 or f/2.8.

Closer Subject, Shallower DoF

Moving closer to your subject significantly reduces depth of field, even with the same lens and aperture settings. This is a key technique for isolating subjects.

Longer Focal Length, Shallower DoF

Telephoto lenses (e.g., 200mm) naturally produce shallower depth of field than wide-angle lenses (e.g., 24mm) at the same aperture and subject distance, enhancing background compression.

Mastering Focus: Your Depth of Field (DoF) Calculation Guide

The Depth of Field (DoF) Calculator is an indispensable tool for photographers seeking precise control over their image's focus and blur. By factoring in lens focal length, aperture, subject distance, and sensor format, it accurately determines the near and far limits of acceptable sharpness, alongside hyperfocal distance and bokeh intensity. For a portrait shot with a 50mm lens at f/2.8 on a full-frame camera with the subject 3 meters away, the calculator reveals a DoF of 3.236 meters, enabling photographers to fine-tune their composition.

Creative and Technical Uses of Depth of Field

Depth of field is a powerful creative tool in photography, allowing artists to guide the viewer's eye and evoke specific emotions. A shallow DoF, characterized by a blurred background (bokeh), effectively isolates the subject, making it pop from the scene – a technique frequently employed in portraiture, product photography, and macro work. Conversely, a deep DoF ensures that elements from the immediate foreground to the distant background remain sharp, essential for expansive landscape photography, architectural shots, and group portraits where every face needs to be in focus. Mastering DoF choices is fundamental to crafting compelling visual narratives and achieving a desired aesthetic.

The Optical Formulas for Depth of Field

The calculation of Depth of Field is based on optical principles that relate the lens's characteristics, the sensor size, and the subject's position.

Key formulas for Near Focus Limit (N_f), Far Focus Limit (F_f), and Hyperfocal Distance (H) are:

  1. Hyperfocal Distance (H) in mm:
    H = (Focal Length² / (Aperture × Circle of Confusion)) + Focal Length
    
  2. Near Focus Limit (N_f) in mm:
    N_f = (H × Subject Distance) / (H + (Subject Distance - Focal Length))
    
  3. Far Focus Limit (F_f) in mm:
    F_f = (H × Subject Distance) / (H - (Subject Distance - Focal Length))
    
    (Note: Distances in these formulas are typically in millimeters for consistency.) The total Depth of Field is then F_f - N_f.
💡 Achieving your desired depth of field often goes hand-in-hand with controlling your light. Our Softbox Size to Subject Distance Calculator can help you optimize your lighting setup for portraits and other compositions.

Calculating DoF for a Portrait Shot

Consider a photographer using a 50mm lens on a full-frame camera (Circle of Confusion = 0.030 mm) with an aperture of f/2.8. The subject is positioned 3 meters (3000 mm) from the camera.

  1. Calculate Hyperfocal Distance (H):
    • H = (50² / (2.8 × 0.030)) + 50 = (2500 / 0.084) + 50 = 29761.9 mm + 50 mm = 29811.9 mm (approx. 29.81 m)
  2. Calculate Near Focus Limit (N_f):
    • N_f = (29811.9 × 3000) / (29811.9 + (3000 - 50)) = 89435700 / (29811.9 + 2950) = 89435700 / 32761.9 = 2730.0 mm (approx. 2.73 m)
  3. Calculate Far Focus Limit (F_f):
    • F_f = (29811.9 × 3000) / (29811.9 - (3000 - 50)) = 89435700 / (29811.9 - 2950) = 89435700 / 26861.9 = 3329.5 mm (approx. 3.33 m)
  4. Calculate Total Depth of Field:
    • DoF = F_f - N_f = 3.33 m - 2.73 m = 0.60 m

The total depth of field is approximately 0.60 meters (or 60 cm), with acceptable sharpness extending from 2.73 meters to 3.33 meters.

💡 When shooting with a shallow depth of field, especially in bright conditions, you might need to control light more precisely. Our Stacked ND Filter Exposure Calculator can help you manage exposure without compromising your desired aperture.

Creative and Technical Uses of Depth of Field

Depth of field is a powerful creative tool in photography, allowing artists to guide the viewer's eye and evoke specific emotions. A shallow DoF, characterized by a blurred background (bokeh), effectively isolates the subject, making it pop from the scene – a technique frequently employed in portraiture, product photography, and macro work. Conversely, a deep DoF ensures that elements from the immediate foreground to the distant background remain sharp, essential for expansive landscape photography, architectural shots, and group portraits where every face needs to be in focus. Mastering DoF choices is fundamental to crafting compelling visual narratives and achieving a desired aesthetic.

Formula Variants for Circle of Confusion and DoF

While the fundamental depth of field formulas remain consistent, variations often arise in how the "Circle of Confusion" (CoC) is determined, which in turn affects the calculated DoF. This calculator uses a common, fixed CoC value for different sensor formats (e.g., 0.030 mm for full frame). However, some advanced DoF calculations might use a CoC derived from pixel pitch or a specific print size and viewing distance, leading to slightly different results based on the desired final output. Another common simplification is the "thin lens approximation," which assumes the lens is infinitesimally thin, slightly simplifying the hyperfocal distance calculation by omitting the "+ Focal Length" term. While these variants exist, the core relationships between focal length, aperture, subject distance, and DoF remain the same, providing photographers with reliable guidance for their creative decisions.

Frequently Asked Questions

What is Depth of Field (DoF) in photography?

Depth of Field (DoF) refers to the range of distance in a photograph where objects appear acceptably sharp. It's not a hard line but a gradual transition from sharp to blurry. Photographers manipulate DoF to control what parts of an image are in focus, using a shallow DoF to isolate a subject with a blurred background (bokeh) or a deep DoF to keep everything from foreground to background sharp, which is crucial for landscape photography.

How do focal length, aperture, and subject distance affect DoF?

Focal length, aperture, and subject distance are the three main factors influencing DoF. A longer focal length, wider aperture (smaller f-number), and closer subject distance all result in a shallower DoF. Conversely, a shorter focal length, narrower aperture (larger f-number), and greater subject distance will produce a deeper DoF. Understanding these relationships is fundamental for photographers to achieve their desired creative vision and achieve specific visual effects.

What is the 'Circle of Confusion' and why is it important for DoF calculations?

The 'Circle of Confusion' (CoC) is the maximum acceptable diameter of a blur spot on a camera's sensor or film that will still be perceived as a sharp point when viewed at a standard distance. It's a critical factor in DoF calculations because it defines the threshold of 'acceptable sharpness.' A smaller CoC value (e.g., 0.020 mm for APS-C) results in a shallower calculated DoF, as the standard for sharpness is higher. Different sensor sizes typically have different CoC standards.