Depth of Field (DoF) Calculator

Plan focus with the near limit, far limit, total DoF, and hyperfocal distance for any focal length, aperture, focus distance, and sensor size. Everything runs locally in your browser.

Inputs

Preset circles of confusion are format-based approximations. Use custom sensor and CoC when matching a camera, print size, or stricter viewing assumption.

Results

Near limit-
Far limit-
Total DoF-
In front of subject-
Behind subject-
Hyperfocal distance-
Hyperfocal near limit-
Circle of confusion-

Tip: Try sliding focus distance slightly—if your DoF shrinks faster than you expect, you may be near the focal plane and need to stop down.

Advertisement

Focus diagram

Depth of field diagram showing camera position, near limit, focus distance, far limit, and infinity when applicable.

Comparison mode

Compare the main setup with a second lens and distance using the same format, units, and circle of confusion.

Setup Lens Focus Near Far Total DoF Front / Behind Hyperfocal

How to use this depth of field calculator

Release Updates

v1.1 (May 20, 2026)

  • Added metric/imperial distance controls, custom circle of confusion, custom sensor dimensions, and expanded camera-format presets.
  • Added front/behind subject split, hyperfocal near limit, one-click hyperfocal focusing, permalink sharing, print, and CSV export.
  • Added the focus diagram, comparison mode, worked example table, prefilled example buttons, and expanded DoF guide/FAQ content.

Depth of field is the zone in a photo or video that appears acceptably sharp. This calculator helps you predict how much of your scene will be in focus based on your camera format, lens, aperture, and focus distance. It’s a practical tool for photographers and videographers who want to plan the look of a shot, whether that’s a creamy background blur for a portrait or wide‑open sharpness for a landscape.

The concept is simple: depth of field gets shallower when you use a longer focal length, a wider aperture (smaller f‑number), or focus closer to your subject. It gets deeper when you stop down the lens, use a shorter focal length, or focus farther away. Sensor size also matters because it changes the circle of confusion, which is the tolerance for what counts as “sharp enough.” This calculator uses commonly accepted circle‑of‑confusion values so you can compare formats like full‑frame, APS‑C, and Micro Four Thirds.

Step-by-step

  1. Select your camera format to set the correct circle of confusion.
  2. Enter your focal length and aperture (f‑number).
  3. Set the focus distance in meters.
  4. Read the near and far focus limits and the total depth of field.
  5. Check the hyperfocal distance if you want maximum sharpness to infinity.

Real‑world examples help clarify how to use the results. If you’re shooting a head‑and‑shoulders portrait at 85 mm and f/1.8, you’ll see a very shallow depth of field, which is great for isolating a subject but requires precise focus on the eyes. If you’re photographing a cityscape at 24 mm and f/8, the depth of field will be much deeper, and the hyperfocal distance can guide you to keep both foreground and background sharp.

For video, this is especially useful when pulling focus or when you need consistent sharpness across a moving subject. A small shift in focus distance can dramatically change the depth of field at wide apertures, so the calculator helps you decide when to stop down or adjust framing. It is also handy for product photography, where you may need the entire object sharp without losing too much background separation.

Keep in mind that stopping down too far can introduce diffraction softness, and zoom lenses can breathe at close focus, slightly changing framing. Use the results as a guide, then confirm with a quick test shot if critical focus matters. The calculator runs entirely in your browser, so you can use it on set without needing an internet connection.

Complete depth of field guide

What is depth of field?

Depth of field is the range in front of and behind the exact focus distance that appears acceptably sharp in a photo or video frame. Only one plane is truly in perfect focus. Everything closer or farther away is slightly blurred, but the blur may be small enough that it still looks sharp at the final viewing size. That acceptable range is the depth of field.

Depth of field is both a technical calculation and a creative choice. A portrait photographer may want a shallow sharp zone so the eyes stand out against a soft background. A product photographer may need the entire object to read clearly. A landscape photographer often wants foreground detail and the far horizon to both look sharp. The same lens can serve all three goals, but the aperture, focus distance, framing, and acceptable-sharpness assumptions change the result.

How aperture affects depth of field

Aperture is usually the fastest way to change depth of field. A wide aperture, such as f/1.4 or f/2, creates a shallow sharp zone and stronger background blur. A smaller aperture, such as f/8 or f/11, creates deeper depth of field because light rays form narrower cones at the sensor. In the calculator, increase the f-number and the near and far limits move farther apart.

The trade-off is exposure and fine detail. Smaller apertures need more light, higher ISO, or slower shutter speeds. Very small apertures can also soften detail through diffraction, especially on high-resolution cameras and smaller sensors. For many cameras, f/5.6 to f/11 is a practical range for general sharpness, while portraits and low-light scenes often use wider apertures for subject separation or exposure.

How focal length affects depth of field

Longer focal lengths usually produce shallower depth of field when subject framing is similar. An 85mm portrait at f/1.8 will normally have less depth of field than a 35mm portrait at f/1.8 if you frame the subject similarly, because the longer lens either magnifies the subject more or forces a different shooting distance. This is one reason telephoto portraits can isolate a subject so strongly.

Focal length comparisons can be confusing because the result depends on what stays constant. If focal length, aperture, focus distance, and circle of confusion all stay fixed, the formula gives a direct result. If you change focal length but move the camera to keep the subject the same size, magnification and perspective change too. Use comparison mode to test the actual setup you intend to shoot instead of relying on a single rule of thumb.

How focus distance affects depth of field

Focus distance has a dramatic effect. The closer you focus, the thinner the sharp zone becomes. This is why close-up product shots, food photography, and macro images often have very little depth of field even at f/8 or f/11. Move the focus distance from 3m to 1m with the same lens and aperture, and the calculator will show the near and far limits tightening quickly.

Depth of field is not evenly distributed around the focus distance. At close distances it can be almost balanced in front of and behind the subject, but as focus distance increases, more of the acceptable sharp zone falls behind the focus point. That is why the in-front and behind-subject split is useful. It tells you whether you have enough tolerance for a subject leaning forward, walking toward camera, or moving away.

What is circle of confusion?

Circle of confusion, often shortened to CoC, is the maximum blur circle that still appears like a point in the final image. It is not only a sensor property. It is an assumption about acceptable sharpness based on format size, enlargement, viewing distance, display size, and eyesight. A smaller CoC is stricter and produces shallower calculated depth of field. A larger CoC is more forgiving and produces deeper calculated depth of field.

Preset calculators usually assign common CoC values by camera format. That is convenient, but it is not the only valid approach. A billboard viewed from far away can tolerate more blur than a large fine-art print viewed up close. A 4K video watched on a phone has different demands from a high-resolution still image cropped heavily. Use the custom CoC field when you need a conservative result, when matching a production standard, or when another focus table uses a known CoC.

What is hyperfocal distance?

Hyperfocal distance is the closest focus distance that keeps infinity acceptably sharp for a given focal length, aperture, and circle of confusion. When you focus at the hyperfocal distance, the far limit reaches infinity and the near limit is roughly half the hyperfocal distance, with a small correction for focal length. This is useful when you want the deepest possible range of acceptable sharpness without focusing directly at infinity.

Hyperfocal focusing is common in landscape, street, documentary, and action work. For example, a wide lens stopped down to f/8 may let you focus a few meters away and keep everything from the foreground to the horizon acceptably sharp. The one-click hyperfocal button sets the calculator focus distance to that value so you can immediately see the resulting near limit and compare it with the foreground objects in your scene.

Depth of field formulas

This calculator uses the standard thin-lens depth of field formulas. Let f be focal length in millimeters, N be aperture f-number, c be circle of confusion in millimeters, and s be focus distance in millimeters.

  • Hyperfocal distance: H = f² / (N × c) + f
  • Near focus limit: Dn = (H × s) / (H + (s - f))
  • Far focus limit: Df = (H × s) / (H - (s - f))
  • If H <= s - f, the far focus limit is infinity.
  • Total depth of field: Df - Dn, or infinity when the far limit is infinity.

These formulas are excellent for planning, but they are still based on assumptions. Real lenses can focus breathe, field curvature can make edges focus differently from the center, and internal focusing designs may change effective focal length at close distances. Treat the output as a strong planning estimate, then test critical shots when the margin is small.

Depth of field examples

A 35mm lens at f/1.8 focused at 2m on full frame gives a modest sharp zone around a person or object. Stop down to f/4 and that zone expands noticeably while the background still separates. Change to 50mm at f/2.8 and focus at 3m, and the subject may have similar framing but a different front/back split. These are the trade-offs comparison mode is designed to make visible.

Use case Settings What to expect Try it
Portrait 85mm, f/1.8, 2m, full-frame Very shallow DoF; focus carefully on the nearer eye and leave room for subject movement.
Landscape 24mm, f/8, 5m, full-frame Deep DoF; check the hyperfocal distance and verify the nearest foreground detail is inside the near limit.
Product photo 50mm, f/5.6, 1m, APS-C Moderate DoF; small products may need f/8, a flatter angle, or focus stacking.
Macro 100mm, f/8, 0.3m, full-frame Extremely shallow DoF; expect millimeter-level tolerance and consider a focus stack.

For video, compare the numbers against the movement in the shot. If an actor walks 40cm toward camera during a line, the in-front distance needs to cover that move or the focus puller needs a planned adjustment. For stills, compare the total depth of field with the physical depth of the subject rather than only the point you focused on.

Portrait depth of field examples

For a tight headshot, depth of field can be very thin. An 85mm lens at f/1.8 focused near 1.5m may leave the nearer eye sharp while the far eye, ears, or hair soften. That can be attractive, but it leaves little room for subject movement or focus error. Stopping down to f/2.8 or f/4 often gives a more reliable portrait while still keeping the background soft, especially if the background is far behind the subject.

Group portraits need much more depth of field. If people stand in two rows, focus on a face in the front row and check whether the behind-subject distance reaches the back row. If it does not, stop down, move back, use a shorter focal length, or arrange the group on a flatter plane.

Landscape and hyperfocal examples

Landscape depth of field is often about foreground placement. If the nearest rock, flower, or path detail is 1m from the camera, focusing at infinity may waste too much depth of field behind the horizon. Hyperfocal focusing lets you pull the focus point closer while keeping infinity acceptably sharp. Use the hyperfocal near limit to check whether that foreground object falls inside the sharp zone.

Wide lenses make this easier. A 24mm lens at f/8 can cover a broad range, while a 70mm landscape detail may need a more careful focus choice. Do not stop down automatically to the smallest aperture; diffraction can reduce fine detail. If the foreground is extremely close and the background matters, focus stacking may be a better answer than forcing everything into one exposure.

Macro depth of field limitations

Macro photography is the hard case for depth of field. At high magnification, the sharp zone can be only a few millimeters or less. Stopping down helps, but the exposure cost is high and diffraction can soften the whole image. Small subject movements, camera vibration, and focus breathing become more visible than they are in normal-distance photography.

For insects, jewelry, coins, electronics, and small products, use the calculator as a warning system rather than a guarantee. If the total depth of field is much smaller than the physical depth of the subject, you may need to align the subject flatter to the camera, add light so you can stop down, shoot a focus stack, or accept a selective-focus look.

Depth of field calculator FAQ

What is depth of field?

Depth of field is the distance range that appears acceptably sharp in front of and behind the exact focus point. It depends on aperture, focal length, focus distance, sensor format assumptions, and circle of confusion.

What is hyperfocal distance?

Hyperfocal distance is the closest distance you can focus while keeping infinity acceptably sharp. When focused at hyperfocal distance, the near limit is roughly halfway to the camera.

What is circle of confusion?

Circle of confusion is the blur size that still looks like a point in the final image. Smaller CoC values are stricter and produce shallower calculated depth of field.

How do I get shallow depth of field?

Use a wider aperture, longer focal length, closer focus distance, and more separation between subject and background. Keep in mind that subject movement and focus accuracy become more critical.

How do I get deeper depth of field?

Stop down to a higher f-number, use a shorter focal length, move farther from the subject, or focus near the hyperfocal distance when the background needs to stay sharp.

Does sensor size affect depth of field?

Sensor size affects depth of field through framing and CoC assumptions. At identical focal length, aperture, focus distance, and CoC, the optical formula is fixed; in practice, larger sensors often use longer lenses or closer positions for the same framing.

Does shutter speed affect depth of field?

No. Shutter speed does not directly affect depth of field. It can indirectly matter if a slower or faster shutter forces you to change aperture, ISO, lighting, or stabilization.

What is the depth of field of a 50mm lens?

There is no single depth of field for a 50mm lens. A 50mm lens at f/1.8 focused at 1m has a much thinner sharp zone than the same lens at f/8 focused at 5m.

Why is my real-world result different from the calculator?

Differences can come from focus error, lens breathing, field curvature, diffraction, motion blur, heavy cropping, display size, viewing distance, or a different circle-of-confusion assumption.

What circle of confusion should I use?

Use the format preset for quick planning. Use a smaller custom CoC for large prints, heavy crops, critical commercial work, or production standards that demand stricter sharpness.

Does this upload my camera settings?

No. The calculator runs in your browser. Your focal length, aperture, distance, sensor size, and comparison settings are not sent to a server.

Related depth of field tools

Depth of field is closely connected to field of view, crop factor, working distance, and video planning. Use the related calculators above when you need to translate a lens between formats, estimate framing, plan storage for long shoots, or set up a timelapse sequence with a consistent focus strategy.

5 Fun Facts about Depth of Field

Hyperfocal math is old-school

The H = f²/(N·c) + f equation dates back to early 20th-century film photography and still underpins modern focus tables.

Classic optics

Phone “bokeh” is simulated

Smartphones use depth maps and segmentation to fake shallow DoF; the tiny sensors natively have very deep focus.

Computational tricks

Diffraction sets a ceiling

Stopping down past roughly f/11 on many sensors softens detail as diffraction spreads light wider than the pixel pitch.

Trade-offs

Film standards linger

Many cinema DoF charts still reference a 0.025 mm CoC from 35mm film days—even when used on digital Super35 sensors.

Legacy numbers

Breathing shifts framing

Focus breathing changes angle of view as you rack focus. Wider lenses tend to breathe less; cinema lenses correct it by design.

Lens behavior

Why depth of field matters

Depth of field turns technical choices into visual intent. It controls whether attention goes to one eye, an entire product, a row of people, or a landscape from foreground to horizon. It also affects practical decisions on set: how much a subject can move, whether a focus pull has enough tolerance, and whether a shot needs more light, a different lens, or focus stacking.

Use the calculator when blocking shots, planning rack-focus moves, choosing a portrait aperture, checking landscape hyperfocal focus, or deciding whether two lens setups will give comparable sharpness. The numbers update instantly, so you can test realistic combinations instead of relying on memory or generic rules.

Explore more tools