ThisCalculator

Technology

Cambridge in Colour Depth of Field Calculator

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Cambridge in Colour Depth of Field Calculator

The Cambridge in Colour Depth of Field Calculator is a free online tool that computes depth of field (DOF) from your camera’s sensor size, focal length, aperture, and focus distance. You enter those four values, and it returns the near focus limit, far focus limit, total depth of field, and hyperfocal distance. It is one of the most cited DOF calculators because it also explains the underlying optics in plain language.

Formula

The calculator uses the standard thin-lens DOF equations. The circle of confusion (CoC) is the maximum blur spot that still looks sharp when the image is viewed at a normal size. Cambridge in Colour uses a CoC of 0.030 mm for full-frame cameras, 0.020 mm for APS-C, and 0.015 mm for Micro Four Thirds, which are the common values used by most DOF calculators.

For a lens focused at distance d with focal length f and aperture N, the near limit is:

Near = (d × f²) / (f² + N × c × d)

The far limit is:

Far = (d × f²) / (f² − N × c × d)

Total DOF = Far − Near. The hyperfocal distance is:

H = (f²) / (N × c) + f

Where c is the circle of confusion in the same units as f and d (millimeters here). When the focus distance equals H, the far limit becomes infinity.

Worked Example

Using the defaults: sensor size 1.5 (APS-C), focal length 50 mm, aperture f/8, focus distance 10 m. The CoC for APS-C is 0.020 mm.

  1. Convert focus distance to mm: 10 m = 10,000 mm.
  2. Compute the denominator for the near limit: f² + N × c × d = 50² + 8 × 0.020 × 10,000 = 2500 + 1600 = 4100.
  3. Near = (10,000 × 2500) / 4100 = 25,000,000 / 4100 ≈ 6097.56 mm ≈ 6.10 m.
  4. Compute the denominator for the far limit: f² − N × c × d = 2500 − 1600 = 900.
  5. Far = (10,000 × 2500) / 900 = 25,000,000 / 900 ≈ 27,777.78 mm ≈ 27.78 m.
  6. DOF = 27.78 − 6.10 = 21.68 m.
  7. Hyperfocal: (2500) / (8 × 0.020) + 50 = 2500 / 0.16 + 50 = 15,625 + 50 = 15,675 mm = 15.68 m.

The calculator shows DOF = 21.68 m, near = 6.10 m, far = 27.78 m, hyperfocal = 15.68 m. The far limit is not infinity because 10 m is less than the hyperfocal distance.

How to Use the Calculator

Start by selecting your sensor size from the drop-down. If you shoot full-frame, choose 1.0; APS-C (crop factor 1.5) choose 1.5; Micro Four Thirds choose 2.0. Then enter the focal length of your lens (in mm), the aperture f-number (e.g., 2.8, 8, 11), and the distance to your subject in meters or feet. The calculator outputs the near and far limits of acceptable sharpness, the total DOF, and the hyperfocal distance.

For landscape photography, set the focus distance to the hyperfocal distance to maximize sharpness from near to infinity. For portraits, you want a shallow DOF, so use a wide aperture (low f-number) and a longer focal length. For macro, DOF becomes extremely thin, often less than a millimeter, so you may need to stop down to f/16 or f/22.

Common Mistakes and Misconceptions

  • Mixing units: The formula requires consistent units. If you enter distance in feet but focal length in mm, the result will be wrong. Convert feet to mm (1 ft = 304.8 mm) or use a calculator that handles both.
  • Ignoring sensor size: A 50mm lens on APS-C gives a different DOF than on full-frame because the CoC changes. The calculator accounts for this, but many people forget to change the sensor setting.
  • Confusing DOF with background blur: DOF is the range of acceptable sharpness, not the amount of blur. Two lenses can have the same DOF but different background blur due to focal length and subject distance.
  • Assuming DOF is symmetric: The far limit extends roughly twice as far as the near limit when focused at 1/3 of the scene depth. This is a rule of thumb, but the actual ratio depends on distance.
  • Using the calculator for macro: At magnification ratios above 1:1, the thin-lens formula becomes inaccurate. For macro, use a dedicated macro DOF calculator that accounts for pupil magnification.

Limitations of the Formula

The thin-lens formula assumes a perfect lens with no aberrations, a circular aperture, and a specific viewing condition (typically an 8×10 print viewed at 25 cm). In reality, lens sharpness, diffraction, and the final print size affect perceived sharpness. The CoC is a convention, not a physical constant. Some photographers use a smaller CoC for critical work, such as 0.015 mm for full-frame when making large prints. The calculator also does not account for diffraction, which can soften the entire image at very small apertures (e.g., f/22). For most practical purposes, the results are accurate enough for planning a shot.

Alternatives and Related Tools

Other popular DOF calculators include DOFMaster, PhotoPills, and the built-in calculators in many camera apps. Some cameras have a DOF preview button that stops down the aperture so you can see the effect in the viewfinder. There are also smartphone apps that use GPS and a compass to calculate hyperfocal distance for landscape photography. The Cambridge in Colour calculator is notable for its detailed tutorial on the subject, which explains the math and the concept of circle of confusion in depth.

Frequently Asked Questions

What is a good circle of confusion value?

For full-frame, 0.030 mm is standard; for APS-C, 0.020 mm; for Micro Four Thirds, 0.015 mm. These values assume a 8×10-inch print viewed at arm’s length. If you print larger or crop heavily, use a smaller CoC (e.g., 0.015 mm for full-frame) to ensure sharpness.

Why does the far limit show infinity when I focus at the hyperfocal distance?

At the hyperfocal distance, the far limit of DOF is mathematically infinite. That means everything from half the hyperfocal distance to infinity appears acceptably sharp. This is why landscape photographers set focus to the hyperfocal distance to maximize depth of field.

How does sensor size affect depth of field?

A smaller sensor (e.g., APS-C vs. full-frame) with the same focal length and aperture gives a deeper DOF because the circle of confusion is smaller. To get the same framing as a 50mm lens on full-frame, you use a 35mm lens on APS-C, which also increases DOF. This is why phone cameras have deep DOF.

Does the calculator work for video?

Yes, the optics are the same. However, video often uses a different CoC because the resolution and viewing distance differ. For 4K video on a full-frame sensor, a CoC of 0.015 mm is sometimes recommended. The calculator’s default CoC is for still photography.

Why is my DOF thinner than the calculator says?

Possible reasons: you are pixel-peeping at 100% magnification (which uses a much smaller CoC), the lens is not as sharp as the ideal, or you are using a larger aperture than you think (e.g., f/2.8 vs. f/4). Also, if you are close to the subject, the thin-lens formula becomes less accurate.

Can I use this calculator for tilt-shift lenses?

No. Tilt-shift lenses change the plane of focus, so the DOF is no longer parallel to the sensor. The calculator assumes the lens is parallel to the sensor. For tilt-shift, use a specialized calculator or the Scheimpflug principle.

Related

Formula used
in sensor | Sensor size | - | 1.5 | 0
in fl | Focal length | mm | 50 | 0
in aperture | Aperture (f-number) | - | 8 | 0
in dist | Focus distance | m | 10 | 0
out dof | Depth of field | m | (2 * dist^2 * aperture * coc) / (fl^2 - aperture^2 * coc^2) | 2
out near | Near limit | m | (dist * fl^2) / (fl^2 + aperture * coc * dist) | 2
out far | Far limit | m | (dist * fl^2) / (fl^2 - aperture * coc * dist) | 2
out hyperfocal | Hyperfocal distance | m | (fl^2) / (aperture * coc) + fl | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.