Try It Yourself: Camera Simulator
The simulator shows depth of field visually. Adjust aperture and focal length to see how they interact with subject distance.
Depth of field is one of the most powerful creative tools available to photographers. It determines how much of your scene appears sharp, from a razor-thin sliver of focus in a portrait to a landscape where everything from the nearest wildflower to the distant mountains is crisp. Understanding and controlling depth of field separates snapshots from intentional photographs.

Our depth of field calculator helps you predict exactly how much of your scene will be in acceptable focus before you press the shutter. By entering your focal length, aperture, subject distance, and sensor size, you can plan your shots with precision. This is especially useful for portrait photographers who want creamy bokeh backgrounds, landscape shooters aiming for front-to-back sharpness, and macro photographers working with extremely thin focus planes.
The calculator uses standard circle of confusion (CoC) values for each sensor format to compute the near focus limit, far focus limit, total depth of field, and hyperfocal distance. These values represent the optical reality of how your lens, sensor, and shooting distance interact. While real-world results can vary slightly due to lens design and diffraction, these calculations are reliable for practical shooting decisions.
Whether you are shooting wide open at f/1.4 for a dreamy portrait or stopped down to f/11 for a sweeping vista, this tool will show you precisely where your zone of sharpness begins and ends. Use it during pre-production planning, on location, or simply to build your intuition about how focal length, aperture, and distance affect your images.
Depth of Field Calculator
Results
—
—
—
—
Far
Understanding Depth of Field
Depth of field (DoF) refers to the range of distances in a scene that appear acceptably sharp in your photograph. It is not a single plane of perfect focus but rather a zone. Objects at the exact focus distance are the sharpest, and sharpness gradually decreases as you move away from that point. The boundaries of this zone, where sharpness drops below an acceptable threshold, define your near and far focus limits.
The concept of “acceptably sharp” is important here. In optical reality, only one precise distance is in perfect focus. Everything else is technically slightly blurred. But at small enough levels of blur, our eyes cannot distinguish the softness from true sharpness. The threshold for this acceptable blur is called the circle of confusion (CoC), and it varies by sensor size because larger sensors are typically viewed at larger print sizes or require less magnification.
The Three Factors That Control Depth of Field
Three primary variables determine how deep or shallow your depth of field will be. Understanding each one gives you creative control over your images.
1. Aperture
Aperture has the most direct relationship with depth of field. A wider aperture (smaller f-number like f/1.4 or f/2) produces a shallower depth of field, isolating your subject against a blurred background. A narrower aperture (larger f-number like f/11 or f/16) produces a deeper depth of field, keeping more of the scene sharp from foreground to background.
This is why portrait photographers often shoot at f/1.4 to f/2.8. The shallow depth of field separates the subject from distracting backgrounds. Landscape photographers, on the other hand, typically choose f/8 to f/16 to maximize sharpness across the entire scene.
2. Focal Length
Longer focal lengths produce shallower depth of field at the same aperture and subject distance. A 200mm lens at f/4 focused at 10 meters will have a much thinner focus zone than a 24mm lens at the same settings. This is one reason telephoto lenses are favored for portraits and wildlife photography, where background separation is desirable.
Wide-angle lenses naturally provide deeper depth of field, which makes them ideal for landscape and architectural photography where you want everything sharp. However, this is partly an illusion of perspective. When you maintain the same subject magnification (the subject is the same size in the frame), the depth of field difference between focal lengths is much smaller than most photographers assume.
3. Subject Distance
The closer you are to your subject, the shallower the depth of field becomes. This is why macro photography is so challenging. When you are centimeters from a tiny subject, depth of field can shrink to fractions of a millimeter. Even at f/16 or f/22, a macro photographer may only have a few millimeters of sharp focus to work with.
Conversely, when your subject is far away, depth of field increases dramatically. If you focus on a mountain range several kilometers distant, practically everything at that distance and beyond will be sharp regardless of your aperture setting.
Sensor Size and Circle of Confusion
Sensor size affects depth of field indirectly. A full-frame sensor has a larger circle of confusion value (0.03mm) than an APS-C sensor (approximately 0.02mm) or a Micro Four Thirds sensor (0.015mm). This means that for the same framing (same field of view and subject size in the frame), a larger sensor produces shallower depth of field.
This happens because to achieve the same framing with a larger sensor, you either use a longer focal length or stand closer to the subject. Both of those changes reduce depth of field. Medium format cameras are prized partly for their ability to produce extremely shallow depth of field with a natural, gradual focus falloff.
Hyperfocal Distance
The hyperfocal distance is the closest focus distance at which everything from half that distance to infinity is acceptably sharp. When you focus at the hyperfocal distance, you maximize the depth of field for any given focal length and aperture combination. This technique is essential for landscape photography where you want both the foreground and the distant horizon to be sharp.
For example, if the hyperfocal distance for your settings is 4 meters, focusing at 4 meters means everything from 2 meters to infinity will be acceptably sharp. Focusing beyond the hyperfocal distance wastes potential sharpness in the foreground. Focusing closer means infinity will start to soften.
Practical Tips for Controlling Depth of Field
- For shallow DoF (portraits, detail shots): Use a wide aperture (f/1.4 to f/2.8), a longer focal length (85mm to 200mm), and get closer to your subject. Full-frame or medium format sensors enhance the effect.
- For deep DoF (landscapes, architecture): Use a narrower aperture (f/8 to f/16), a wider focal length (16mm to 35mm), and focus at the hyperfocal distance. Avoid going narrower than f/16 on most lenses to prevent diffraction softening.
- For macro photography: Accept that depth of field will be extremely thin. Use the narrowest practical aperture, consider focus stacking (taking multiple shots at slightly different focus points and combining them), and use a sturdy tripod.
- Watch for diffraction: While narrower apertures increase depth of field, going too far (f/22 and beyond on most sensors) causes diffraction, which softens the entire image. The sweet spot for most lenses is f/8 to f/11 for overall sharpness.
- Use live view or depth of field preview: Many cameras have a DoF preview button that stops the lens down to the taking aperture so you can see the actual depth of field through the viewfinder or on the LCD.
Depth of Field in Practice: Common Scenarios
Headshot portrait (85mm, f/1.8, 2m): On a full-frame camera, the depth of field is only about 8 centimeters. The tip of the nose and the ears may be slightly soft if the eyes are in perfect focus. This creates a beautiful separation from the background but demands precise focusing.
Group photo (35mm, f/5.6, 4m): The depth of field expands to several meters, enough to keep a group of people arranged in two or three rows all in acceptable focus. Stopping down to f/8 provides additional insurance.
Landscape (24mm, f/11, hyperfocal): Focused at the hyperfocal distance on a full-frame camera, everything from roughly 1 meter to infinity is sharp. This is the classic approach for scenes with strong foreground interest leading to a distant background.
Macro (100mm, f/8, 0.3m): Even at f/8, depth of field is only about 1.5 millimeters. This is why macro photographers rely heavily on focus stacking. A single shot simply cannot render an entire insect or flower sharp at such close distances.
The Math Behind the Calculator
The calculator uses the standard thin-lens DoF equations. First, it computes the hyperfocal distance: H = (f squared) / (N times CoC) + f, where f is the focal length in millimeters, N is the f-number, and CoC is the circle of confusion for your sensor. Then the near limit is calculated as Dn = (s times (H – f)) / (H + s – 2f), and the far limit as Df = (s times (H – f)) / (H – s), where s is the subject distance. When the subject distance exceeds the hyperfocal distance, the far limit extends to infinity.
These formulas assume a perfect thin lens, which no real lens is. In practice, lens design, floating element focus systems, and field curvature can shift the actual depth of field slightly. But for planning purposes, these calculations are accurate enough to make reliable creative decisions in the field.
Related Tools and Guides
- Hyperfocal Distance Calculator — Find the focus distance that maximizes sharpness from near to infinity
- Crop Factor Calculator — See how sensor size affects equivalent focal length and depth of field
- Portrait Photography Guide — Use shallow depth of field for stunning portrait backgrounds
- Bokeh — Understanding the aesthetic quality of out-of-focus areas
- Macro Photography — Depth of field at extreme close-up distances
- Print Size Calculator — Check resolution for printing your images