If you dabble in photography, have you ever thought any of these things to yourself:

"My aperture is wide open, but I still can't get an artsy blurry background, what gives?"

"I'm shooting a landscape in low light and don't want to bump up my ISO, how much can I widen my aperture but still keep everything in focus?"

"Photography is a fun hobby and all, but I wish it had more math..."

If you answered "yes" to one or more of these, then it's time to take a plunge into the depths...of field.

The concept of depth of field is an important one for any photographer to grasp, and knowing how to properly manipulate depth of field (which I will abreviate DoF for the remainder of this article) can mean the difference between an average picture and a great picture.

**Depth of Field Explanation**

In simple terms, DoF is a term for the range of distances from the camera that appear to be in-focus. In technical terms, the picture is only in-focus for the infinitesimally thin plane that the camera is firmly focused on (the subject distance), but there exists a range of distances around that thin plane that are not technically "in-focus", but appear to be in-focus since they are pretty close to the actual focus point. These ranges between "perfectly focused" and "out of focus" or "blurry" are known as the Depth of Field.

In the photo below that I took of a little bird outside my porch, you can see that the bird is in focus, as well as some of the branches immediately around it, but the branches in front of and behind the bird are noticeably blurry (but you can still tell that they are branches). The tree behind the bird, on the other hand, is so out of focus that it is almost a homogeneous sheet of green with subtle highlights.

In the above circumstance, the very shallow depth of field was on-purpose for both practical and artistic reasons. From a practical standpoint, the long focal length (250mm) and relatively wide aperture (f/6.3) were both fairly necessary. The long focal length (as long as my lens allowed) served to make the bird (which was about 10m away from me) appear closer to me. The relatively wide aperture (almost as wide as that lens could go) let more light into the camera, allowing me to keep the shutter speed fast without increasing ISO. The fast shutter was necessary to both prevent camera shake as well as capture any motion the bird made.

From an artistic standpoint, the shallow depth of field served to make the bird practically the only thing in the image that appeared sharp, which makes it "pop", since people's eyes are naturally drawn to the part of the image that appears in-focus. For an image such as this, where there is a single subject and everything else is just "background", it is usually a good practice to only have your subject in-focus. It's still nice to have the branches and the small flower in the picture, but they aren't meant to be the focus of the image. You don't want viewers to have to play "Where's Waldo" with a picture, you want to make it immediately clear where the subject is.

This case was an example of a happy instance where both the practical and artistic considerations for the picture were in alignment, and not conflicting. This is not always the case, as we will dive into further.

**Why Knowing What Affects Depth of Field Is So Important**

There will not always be times when the practical and artistic considerations of a picture are compatible.

Let's examine the example hinted at in the beginning of this article: shooting a landscape in low light.

Most people know that a wider aperture (lower f-stop number) tends to reduce depth of field, with a smaller aperture increasing it. It makes sense, then, to shoot a landscape shot (something where you want a large depth of field so that the entire landscape is in-focus) at a small aperture. The problem is that a small aperture lets in less light, meaning that shutter speed is reduced. This isn't such a problem if there is a large amount of ambient light available, but that may not always be the case (such as during golden hour or twilight). In this case, you have a few options: you can use a tripod and do a longer exposure, which could be a viable option, or you could increase the aperture at the risk of narrowing DoF, or you could increase ISO and possibly introduce more noise into the image than desirable.

Each option has obvious drawbacks. Using a tripod seems to have the least amount of drawbacks, as camera shake becomes less of an issue, and you would still be able to shoot at a desirable aperture and ISO. But you don't always have a tripod with you, and doing a long exposure may not be the best idea if there is anything moving in the scene (although long exposure landscapes can be cool, if you know what you're doing).

If a tripod is ruled out, then that leaves us with two options in order to keep the shutter speed fast enough to prevent camera shake: increase aperture or increase ISO (or a combination of the two). I always treat increasing ISO as a last resort, since it introduces noise into the picture that is difficult (if not impossible) to remove in post-production. However, blur due to a shallow DoF is practically impossible to remove, so increasing aperture comes at a high risk.

As we will see later, though, increasing aperture may not actually come at a huge price. Landscapes are usually shot at shorter focal lengths, and the point of focus is usually fairly far from the camera. Both of these factors tend to increase depth of field (a lot), so shooting at a wide aperture may not actually degrade DoF by a significant amount. So, depending on the specific focal length and object distance, you can probably feel free to make the aperture as wide as you want, and preserve a low ISO, which is the ideal outcome!

**Factors That Affect Depth of Field (Warning: Math)**

*Note: for my American brethren, I am using metric units throughout this article. Just recall that a meter is about a yard, or about one pace of someone of average height. *

There are four main factors that affect the DoF: focal length, f-stop number (the one that you vary in aperture priority, which I will refer to as 'N' from here on out), subject distance (the distance between the camera and whatever the camera is focused on), and the circle of confusion constant.

The circle of confusion may sound *confusing* (pun heavily intended) but it is really just a number that represents how out-of-focus the image can get before it becomes noticeably blurry on the camera's image sensor. As we touched on before, the image is only technically in-focus at the radius about the subject distance, but areas in front of and behind the subject can still appear to be in-focus to a certain extent. The circle of confusion constant is determined by the camera sensor, so you don't have any control over it (other than buying a new camera). So the determination of DoF becomes largely an exercise in manipulating the first 3 variables: focal length, f-stop (N), and subject distance. Clever choice of these variables will be key in getting the right depth of field for your particular composition.

The two main depth of field equations are shown below. The first represents the closest distance that appears in-focus, or the "near depth of field", and the second represents the farthest distance that appears in focus, or the "far depth of field." Subtracting the two gives the total depth of field.

In the above equations, f represents the focal length, N represents the f-stop number, s represents the subject distance, and c represents the circle of confusion constant (usually around 20 μm for most crop-sensor cameras).

They aren't the worst equations in the world, but they aren't exactly intuitive either. It would take quite the savant to be able to crunch these in your head during a shoot. A calculator would be able to do it quite fast, but having to pull out your phone during a shoot isn't the best thing either (I'll link to a calculator later in this article). Lookup tables provide a more convenient (and non-technological) approach, which I have also included later in this post, but they can still be clumsy to use.

It's better to have an intuitive sense of depth of field so that, on the fly, you can quickly determine which factors are important and which ones aren't for a given situation. This intuition is what we will try to build.

**First: A Note on Aperture **

Many people are confused by the fact that *reducing* the f-stop number *increases* the aperture, and some people (mistakenly) say that "they got it backwards!"

It is not, in fact, backwards.

You see, the aperture of a camera lens is given by the equation:

Where f is the focal length and N is the "f-number" or "f-stop number", which is commonly abbreviated as something like f5.6 or f11, when it reality it is f/5.6 or f/11.

The simple aperture equation shows two important things. The first is that the "f-number" that you would vary in aperture priority mode is on the *denominator* of the expression, and anyone who has studied fractions at any point in their life should know that *increasing *the denominator *reduces* the number, if the numerator stays the same. That's why increasing the f-number reduces the aperture.

The second important takeaway is that the equation is *squared*. Because of this, changing the aperture to go up one "stop" (which is photographer lingo for doubling the amount of light coming in) would mean that the aperture must be changed not by a factor of 2, but by a factor of the *square root* of two. To go up one stop (varying only aperture), you must divide the f-number by the square root of two (about 1.4). To go down one stop, multiply it by the square root of two. Easy! It's not the most intuitive calculation to do in your head, so most people just memorize that the full-stop f-number values are 1, 1.4, 2, 2.8, 4, 5.6, 8, 11, 16, 22, 32, etc. Most inexpensive lenses can only go to an f-number as small as 4 or 5.6, where the more expensive zoom lenses may be able to go down to 2.8 or lower. While the difference between 2.8 and 5.6 doesn't seem like a lot, looking at the numbers listed above will show you that it is indeed 2 full stops of light, which is nothing to scoff at.

One more thing that confused me for awhile was that the aperture equation includes focal length, so I wondered if increasing focal length was actually letting more light into my camera. To test this, I opened a blank document on my laptop (such that my screen was pure white) and got one of my zoom lenses and put my camera in aperture priority. I framed the shot so that all the camera could see was the pure white computer screen at two different zooms, and made sure that my aperture wouldn't change. I then looked to see what the camera said my shutter speed should be in each case. If increasing the focal length actually did let more light in, then the shutter speed should reduce for the longer focal length shot, right? The camera, however, said that the shutter speeds should be the exact same in each case. I took the pictures just to make sure, and they were the exact same exposure.

So why doesn't the focal length change the amount of light coming in?

As it turns out, when you look at the total equation for luminance on the image sensor, it all makes sense. Increasing the focal length actually does increase the aperture (by the factor squared), but it also *reduces* the field of view by the same square factor! This exactly counteracts the aperture increase, and the result is no net light increase or decrease into the camera. Neat!

**How to Calculate Depth of Field (3 Ways)**

**1. The Math (Badass) Way**

The equations for the near and far depth of field are nearly the same except for a minus sign in the denominator. We can simplify them by making the assumption that the subject distance (s) is much larger than the focal length (f), which is true in most cases (unless you are *really* close to the subject). This simplifies the denominator to the following term: (use the plus sign for the near depth and minus sign for the far depth).

Alright, so here's what you can do fairly easily in your head: first, square the focal length in millimeters. It isn't too hard, just remember that , , etc. You don't have to be too exact with this, just round the focal length to the nearest 10 and go from there, we just need to get about on the right order of magnitude.

Next, calculate . Recall that c is about 20 μm, but since we did the focal length squaring in mm, then the microns actually cancel out, so you can just use 20 for c, which makes things easier. As with the focal length, just round the subject distance to the nearest 5m or so, and round the f-number to the nearest full stop (or something that makes the math easy).

Alright, almost done, all we have to do now is just compare the two numbers. If the number is *much** greater* than , i.e. if and , then the depth of field is going to be very shallow. If, on the other hand they are on the same order of magnitude, i.e. if and , then the depth of field will be pretty wide. If they are equal, then we have reached the *hyperfocal distance (*more on that later).

The more intuitive thing to remember is that the denominator changes with respect to , but only linearly with and , so if your subject distance is set and you are looking to change either aperture or focal length, remember that increasing the focal length will do a *lot* more to decrease the depth of field than changing the aperture. Also keep in mind that if you are shooting a portrait and want a very soft background, try separating your subject from the background (along with using a long lens and a wide aperture) in order to make the background further away from the depth of field limits.

**2. The Calculator (Lazy) Way**

I thought about including a calculator in this post but didn't feel like making one, and they already exist on the web so why bother. Here is a link to a good depth of field calculator.

Calculators are useful but I think developing an intuition for depth of field will pay off more in the long run. When you're out on a shoot you're not going to want to be stopping before every shot to whip out your phone and try to get a signal. It would be a good idea, though, to consult a calculator *before* a shoot if you know what kinds of shots you will be taking.

**3. Lookup Tables (The Engineer Way)**

I'm an engineer, and while engineers certainly like calculators, we probably like tables even more. Why? Because tables provide everything in a quick and easy to understand way that doesn't rely on technology. I have a few tables sitting at my desk for various things that I calculate often, and it's faster to glance up at the table than it is to open up the necessary calculation tool.

I've made a few color coded tables below for a few different f-stops. You can feel free to print these tables off and stuff them in your camera bag to whip out during a shoot. (Click on the image to make it bigger).

As you can see, for a wide-angle lens, the subject distance doesn't have to be very far (even at a wide aperture like f/2) before the depth of field goes to infinity, so shooting landscapes at a wide angle and wide aperture is perfectly okay in most cases. Conversely, long focal lengths have a pretty narrow depth of field for subjects within about 10 meters, even at small apertures.

**Hyperfocal Distance**

They gave it a cool name because it's a cool thing to know. The hyperfocal distance is the subject distance for a given focal length and f-number that will make the depth of field infinite behind the subject, and extend to half the subject distance in the near-field. It's a good thing to know for landscape photography because it gives you an idea of where to focus in the scene in order to maximize depth of field.

The equation for hyperfocal distance is:

The approximation to the right makes this equation fairly easy to do in your head if you use the tricks we talked about earlier. Just take the focal length in mm and the circle of confusion in microns and do the math. Even rounding things off, it'll get you pretty close (you aren't going to be measuring subject distance to the millimeter, anyway).

For example, for a focal length of 35mm and N of 8, I would do the following: since I don't know off the top of my head, I'd take and and kinda split the difference between 900 and 1600, so about 1200 (even numbers work better). is , which is 160. So I just have to divide 1200 by 160, which is 7.5 (recall 12/16 is equal to 3/4, or 0.75, so this is just that times 10). So, our back of the envelope depth of field calculation gave us 7.5 meters, how does that compare to the actual value? Well, if we plug real numbers into the full equation then we get 8.1 meters, so our approximation was pretty close! Even if we had been lazy and approximated to 10 meters, it still would have given us a pretty good idea of where to focus our camera.

In the above example, if we focused our camera at 8.1 meters in front of us with a focal length of 35mm and an f-number of 8, then everything from 4.05m (half the subject distance) to infinity would be in-focus.

There is a concept in Physics known as Fermi Estimation, which is basically doing this: rounding numbers to rough orders of magnitude in order to do quick calculations in your head and get a pretty good idea of what the actual answer is.

For reference, here is a hyperfocal distance table at f/4:

**Accuracy of the Equations**

The depth of field tables were generated based on the exact depth of field equations, but, being the scientifically-minded person that I am, I wanted to see how they compared to real-life data.

In order to test this, I set up a little experiment in my hallway: I taped small pieces of paper on my wall that were separated by 25 cm, and wrote the distances on each one. I then set up my camera at the "zero" point.

The setup looked like this:

I then put my 50mm prime lens on my camera, which can stop down to f/1.8, and focused on the 1.00m piece of paper. I took several shots at apertures from f/2 to f/22 in one stop increments, and observed the differences.

As you can see below, the depth of field is so narrow at f/2 that you can't even tell that the piece of paper at 0.25m has any writing on it at all. By the time we get to f/22, things appear to be more in-focus...

What's interesting is that, according to the equations used in the tables I made, the depth of field for f=50mm and s=1m at N=22 is only about 30cm. In the above picture for f/22, it certainly looks to me like the writing from 0.75m to 1.5m is pretty well in-focus, with the other pieces of paper still being readable. It may look different if I print these pictures out, but it seems that the circle of confusion constant of 18 microns that I used for my Canon Rebel T5i is fairly conservative. I even zoomed way in on these images and couldn't tell a heck of a lot of difference in sharpness between the 0.75m writing and the 1.00m writing, so keep that in mind when using these tables or other calculators: subjects outside of the depth of field may still appear fairly in-focus, so if the goal is to blur them out, then make sure they are well outside of the depth of field that the calculator/table gives you.

**Conclusion**

If you've made it this far then I salute you!

Depth of field is tricky concept that has many subtleties, but the basics are fairly straight-forward. While my approach using equations and tables has its merits, there is no substitute for good old-fashioned experimentation with your camera. The great thing about digital photography is that you can snap a bunch of pictures with different settings and throw out the ones you don't like. That said, I encourage you to study the tables and equations, and think critically about depth of field before pressing the shutter release.

With that said, I have a few final tips:

When starting out in photography, I immediately set my aperture to either "full open" or "as closed as possible" because I wanted either a really shallow depth of field or a really wide one. If you read this article, then you should know that this isn't necessary in many cases, and could in fact be detrimental. The reason is that lenses have an "optimal aperture" for clarity, which varies with the lens but is usually around f/8 to f/11, so using these "mid-range" f-numbers is a good practice. There will, of course, be times when it is practical to open the aperture wider or make it narrower, but now I usually treat f/8 as my starting point and go from there. Manipulating focal length and subject distance goes a long way in getting the depth of field you are looking for.

Finally, it's not always a good idea to shoot portraits with the aperture wide open. Why? Well, I usually shoot portraits with a telephoto lens and a decently short subject distance. This, combined with a wide aperture, will give you a **razor thin** depth of field. While this can give a cool-looking blurry background, it also can create the problem of not getting your subject completely in-focus. If your depth of field is on the order of millimeters, then any shift of you or your subject after you focus the shot can mean the difference between a super sharp, nice looking picture and a kinda fuzzy, unprofessional picture. This difference may not become apparent until you get the pictures on your computer and start editing them. So, give yourself a bit of leeway and shoot with a narrower aperture.

Well that's all I have, if you have any questions, comments, or concerns please leave them below.

Very nice, exactly what I was looking for. Is it possible to share the Excel you have created? I would like to change the colors and the notation of the focal length and then make a card to carry around with my photogear. Regards Erik