Camera Depth of Field (DoF) Calculator
Calculate a camera's depth of field from focal length, aperture, subject distance and sensor size. Get the hyperfocal distance, near and far focus limits, total depth of field, and which side of the subject has more DoF. Pure optics math — no camera or photo upload needed.
Input
Camera
Picks a standard circle-of-confusion (CoC) value for the sensor
Lens & Subject
Just the f-number — enter 5.6 for f/5.6
Output
| Property | Value |
|---|---|
| No data yet | |
Guides
What does this calculator do?
Enter your focal length, aperture (f-number), subject distance, and sensor size, and this tool calculates your camera's depth of field (DoF) — the zone in front of and behind your focus point that renders acceptably sharp. It reports the hyperfocal distance, the near and far focus limits, the total depth of field, and which side of the subject — in front or behind — has more of it.
This is a pure optics calculator: no camera, webcam, or photo upload involved, just the standard thin-lens depth-of-field equations used across photography references and DoF tables:
- Hyperfocal distance: H = f² / (N·c) + f — the focus distance beyond which everything out to infinity is acceptably sharp.
- Near limit: Dn = s·(H − f) / (H + s − 2f)
- Far limit: Df = s·(H − f) / (H − s) — infinite once the subject distance
sreaches or passes the hyperfocal distanceH.
Here f is focal length, N is the f-number, c is the circle of confusion (CoC), and s is the subject distance — all converted to the same unit before the math runs.
Choosing a sensor size
The circle of confusion depends on sensor size: a smaller sensor magnifies the same print or screen more, so it can tolerate less blur before it looks soft. Pick a preset and the calculator fills in the standard CoC value used across most published DoF tables:
| Sensor | CoC |
|---|---|
| Full Frame (36 × 24 mm) | 0.030 mm |
| APS-C Canon (22.3 × 14.9 mm) | 0.019 mm |
| APS-C Nikon / Sony / Fuji (23.6 × 15.7 mm) | 0.020 mm |
| Micro Four Thirds (17.3 × 13 mm) | 0.015 mm |
| 1-inch type (13.2 × 8.8 mm) | 0.011 mm |
| Phone / Compact (7.6 × 5.7 mm) | 0.006 mm |
| Medium Format (44 × 33 mm) | 0.037 mm |
Pick Custom to type in your own CoC — useful for an unusual sensor, a stricter/looser sharpness standard, or matching a specific print size and viewing distance.
How to use it
- Pick your sensor size (or Custom, and enter a circle-of-confusion value in mm).
- Enter your focal length in millimeters and your aperture as the f-number (e.g.
5.6for f/5.6). - Enter the subject distance and pick meters or feet.
- Read the result line for the in-focus range, and the details table for the hyperfocal distance, near/far limits, total depth of field, and which side of the subject has more of it.
Why is there more depth of field behind the subject than in front?
Depth of field is never split evenly around the focus point — the far limit always extends farther than the near limit is pulled in, and the gap grows the closer you get to the hyperfocal distance. At true macro distances the split gets close to even; focus near infinity (at or past the hyperfocal distance) and virtually all of the depth of field falls behind the subject, extending to infinity.
What is the hyperfocal distance useful for?
Focusing at the hyperfocal distance maximizes depth of field for a given focal length and aperture — everything from half the hyperfocal distance out to infinity stays acceptably sharp. It's the classic landscape-photography trick for getting a whole scene, near foreground to a distant horizon, in focus with one focus point.
Does this run on my device?
Yes — entirely in your browser, or via the API if calling it programmatically. No photo or camera data is uploaded anywhere; it's just arithmetic on the numbers you type in.