Calculadora de Profundidade de Campo (DoF)
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
Hn = f²/(N·c); Near = D·Hn/(Hn+D); Far = D·Hn/(Hn-D); DoF = Far − Near
About this calculator
This calculator determines the depth of field (DoF) for cameras, based on the hyperfocal distance. Depth of field is the zone of distances, in front of and behind the focus point, that appears acceptably sharp in the image. It is calculated from focal length (f), f-number (aperture, N), subject distance (D), and circle of confusion (c), a value depending on the camera sensor size.
The process first calculates the hyperfocal distance (Hn = f²/(N·c)), which is the distance from which everything is acceptably sharp to infinity. Then, the near (Near = D·Hn/(Hn+D)) and far (Far = D·Hn/(Hn-D)) sharp distances are computed, provided D is less than Hn. The depth of field is the difference between Far and Near. If D is greater than or equal to Hn, DoF extends to infinity.
Use this calculator when planning landscape, portrait, or macro photography where sharpness control is critical. For example, landscapes require large DoF to keep foreground and background sharp; portraits use shallow DoF to isolate the subject. The tool is useful for both amateur and professional photographers to predict the outcome before shooting.
Cautions: The circle of confusion (c) varies by sensor: 0.030 mm for full-frame, 0.020 mm for APS-C, 0.015 mm for Micro 4/3. Using the wrong value may underestimate or overestimate DoF. Also, the formula assumes ideal lenses and ignores diffraction; for very small apertures (e.g., f/16+), actual sharpness may be lower. Always verify with practical tests.
Frequently asked questions
What is hyperfocal distance and how does it affect depth of field?
Hyperfocal distance is the focus distance that maximizes depth of field, making everything from half that distance to infinity sharp. If you focus at that distance, DoF extends from the near point to infinity.
Which circle of confusion should I use for my camera?
For full-frame, use 0.030 mm; for APS-C (1.5x crop), use 0.020 mm; for Micro 4/3, use 0.015 mm. Check your camera manual or sensor specs for accuracy.
Does the calculator work for any subject distance?
Yes, as long as the subject distance (D) is greater than zero. If D is greater than or equal to the hyperfocal distance, the depth of field becomes infinite (to infinity).
Why does the calculated depth of field differ from reality at very small apertures?
The formula ignores diffraction, which reduces overall sharpness at apertures like f/16 or smaller. In such cases, the calculated DoF may be larger than the actual perceived sharpness.
Can I use this calculator for video?
Yes, as long as you know the lens parameters (focal length and aperture) and the sensor's circle of confusion. It is useful for planning shots with selective focus.