Bokeh Simulator & Depth of Field Calculator
- Near limit
- m
- Result
- Far limit
- m
- Result
- Relative background blur
- mm
- Result
This calculator works out the depth of field (the zone of acceptable sharpness) and simulates the background blur (bokeh) you would get with a given camera lens, aperture, and focus distance. You enter focal length, aperture (f-number), focus distance, and your camera’s sensor size, and it returns the near and far limits of sharp focus, the total depth of field, and a relative blur size for the background. The result helps you predict how much background separation a lens will give before you buy it or set up a shot.
Formula
The depth of field is calculated from the lens focal length (f, in mm), the aperture f-number (N), the focus distance (d, in meters), and the circle of confusion (c, in mm). The circle of confusion is the largest blur spot that still looks like a point to the human eye at a given print size and viewing distance; it is a fixed value for each sensor size, typically 0.029 mm for full-frame, 0.019 mm for APS-C, and 0.015 mm for Micro Four Thirds.
The standard formulas are:
- Near limit = (d × f²) / (f² + N × c × d)
- Far limit = (d × f²) / (f² − N × c × d)
- Depth of field = Far limit − Near limit
All distances must be in the same unit (meters). The far limit becomes infinity when the denominator reaches zero, which happens at the hyperfocal distance. The relative background blur is an approximation of the diameter of the blur circle for a background at infinity, given by (f² / (N × (d − f))) × 1000, which gives a value in millimeters.
Worked Example
Using the default values: focal length 50 mm, aperture f/1.8, focus distance 3 m, circle of confusion 0.029 mm.
- Near limit = (3 × 50²) / (50² + 1.8 × 0.029 × 3) = 7500 / (2500 + 0.1566) = 7500 / 2500.1566 ≈ 3.00 m
- Far limit = (3 × 50²) / (50² − 1.8 × 0.029 × 3) = 7500 / (2500 − 0.1566) = 7500 / 2499.8434 ≈ 3.00 m
- Depth of field = 3.00 − 3.00 = 0.00 m (actually about 0.002 m, rounded to 2 decimals)
- Relative background blur = (50² / (1.8 × (3 − 0.05))) × 1000 = (2500 / 5.31) × 1000 ≈ 470,800 mm, which is 470.8 m – a huge number because the background is at infinity.
The calculator rounds the depth of field to two decimals, so at 3 m with a 50 mm f/1.8 lens on full-frame, the depth of field is essentially zero – only about 2 mm. This is why portrait photographers use wide apertures to isolate the subject.
How to Read the Results
The depth of field tells you how much of the scene in front of and behind your focus point will appear acceptably sharp. A shallow depth of field (small number) means only a thin slice is sharp, which is good for portraits or macro shots where you want the background blurred. A deep depth of field (large number) keeps more of the scene sharp, which is useful for landscapes or group photos.
The relative background blur number is a comparative value, not an absolute measurement. A higher number indicates a larger blur circle, meaning more background separation. For example, a 50 mm f/1.8 lens at 3 m gives a much larger blur than a 24 mm f/4 lens at the same distance, because the longer focal length and wider aperture both increase blur.
Common Mistakes and Misconceptions
One frequent error is mixing units – focal length in mm and distance in meters, then forgetting to convert. Always keep the circle of confusion in mm and the focus distance in meters, but the formula requires consistent units, so convert the focal length to meters (divide by 1000) if you do the math manually. The calculator handles this internally.
Another misconception is that a wider aperture always gives more background blur. While f/1.4 blurs more than f/2.8 at the same focal length and distance, the focal length and distance to the subject matter more. A 200 mm lens at f/4 will blur the background far more than a 24 mm lens at f/1.4, because the longer lens magnifies the background more.
Also, the depth of field is not split evenly – it extends roughly one-third in front of the focus point and two-thirds behind it, but this ratio changes with distance. At macro distances, the split is closer to 50/50.
How to Choose Settings for Desired Bokeh
To maximize background blur (bokeh), you need three things working together:
- Longer focal length – a 85 mm lens blurs more than a 35 mm lens at the same aperture.
- Wider aperture – f/1.4 blurs more than f/5.6.
- Closer focus distance – the closer you focus, the more the background falls out of focus.
If you want a deep depth of field for a landscape, use a short focal length (16-24 mm), a narrow aperture (f/8-f/16), and focus at the hyperfocal distance, which the calculator can help you find by adjusting the focus distance until the far limit reaches infinity.
Sensor Size and Circle of Confusion
The circle of confusion value depends on the sensor size. Full-frame cameras use about 0.029 mm, APS-C about 0.019 mm, and Micro Four Thirds about 0.015 mm. This means that for the same focal length and aperture, a smaller sensor has a deeper depth of field because the circle of confusion is smaller relative to the image. In practice, a 50 mm lens on APS-C behaves like a 75 mm lens on full-frame in terms of field of view, but the depth of field is deeper for the same f-number.
When you compare cameras, you should use the actual focal length of the lens, not the equivalent focal length, because the depth of field formula uses the real focal length.
Limitations of the Formula
The classic depth of field formula assumes a perfect lens, a circular aperture, and a specific print size and viewing distance. Real lenses have aberrations that can soften edges, and the actual sharpness may differ. Also, the circle of confusion is a convention, not a physical constant – different photographers may use different values. The relative background blur is an approximation that assumes the background is at infinity; for closer backgrounds, the blur is smaller.
This calculator is a planning tool, not a guarantee of the final image. Diffraction at very narrow apertures (f/16 and beyond) can reduce overall sharpness, which the formula does not account for. For precise results, you would need to test your specific lens.
Frequently Asked Questions
What is the hyperfocal distance and how do I find it? The hyperfocal distance is the closest focus distance at which the far limit of depth of field reaches infinity. To find it with this calculator, increase the focus distance until the far limit shows “infinity� or a very large number. For a 50 mm lens at f/8 on full-frame, it is about 10.8 m.
Does the calculator work for any camera? Yes, as long as you enter the correct circle of confusion for your sensor size. Use 0.029 for full-frame, 0.019 for APS-C, and 0.015 for Micro Four Thirds. For medium format, use about 0.04 mm.
Why does my phone camera have such deep depth of field? Phone cameras have very short focal lengths (typically 4-6 mm) and small sensors, which makes the circle of confusion tiny. Both factors increase depth of field dramatically, so nearly everything is sharp.
What is the difference between bokeh and depth of field? Depth of field is the range of acceptable sharpness; bokeh is the aesthetic quality of the out-of-focus areas. A lens can have shallow depth of field but harsh, distracting bokeh, while another lens with the same depth of field produces smooth, creamy bokeh. This calculator only predicts the amount of blur, not its quality.
Can I use this for video? Yes, the same physics applies. But for video, you often need a deeper depth of field to keep subjects in focus while moving, so you might choose a smaller aperture or a wider lens.
Related
Formula used
in fl | Focal length | mm | 50 | 0 in ap | Aperture (f-number) | - | 1.8 | 0 in fd | Focus distance | m | 3 | 0 in co | Circle of confusion | mm | 0.029 | 0 out dof | Depth of field | m | (2 * fd^2 * ap * co) / (fl^2 - (fd * co)^2) | 2 out near | Near limit | m | (fd * fl^2) / (fl^2 + ap * co * fd) | 2 out far | Far limit | m | (fd * fl^2) / (fl^2 - ap * co * fd) | 2 out blur | Relative background blur | mm | (fl^2 / (ap * (fd - fl))) * 1000 | 1
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.