Photography / Tips and Solutions

How Focus Works

Before there was autofocus, there was focus. The camera is a light-tight box that is used to expose a photosensitive surface (film or digital sensor) to light. In order to focus the light onto the surface, most cameras (and your own eyes) use a lens to direct the light. Why did I say, “Most?” Well, there are many types of cameras around that do not rely on lenses to focus light. The “pinhole camera” is a box with a tiny hole on one end and a photosensitive surface on the other. Light comes through the tiny opening and is projected onto the rear wall of the box. A search of the Internet or your local library will reveal that scientists and engineers are currently working on developing lens-less cameras that are never out of focus and avoid the unfortunate characteristics imparted to light when it passes through glass or plastic lenses. For the time being, however, nearly all of us are using cameras that focus light through a lens.


A lens is an optical device that consists of a curved material that allows light to pass through it. Depending on the design, a camera lens, either built into the camera or attached and interchangeable, consists of one or more elements that both diverge and converge light to focus it onto the photosensitive surface and re-assemble the light reflecting from the scene that has passed through the optics, resulting in an image. You might see lens specifications on the B&H Photo website that mention “elements” and “groups.” Each individual piece of glass is an element and one or more elements are designated into groups inside the camera.

Why do we need to bend the light to create an image? Well, we do not truly need to bend the light at all. The issue is that the film, sensor, or back wall of your eyeball is usually much smaller than the view we are trying to capture. Therefore, we need to bend the light to reduce the size of the image. How else would you get an entire mountain or building to fit onto a camera sensor without bending the light?

Not only does the lens bend the light, it also slows it down. The speed of light changes when it passes through translucent materials. So, light is bending and slowing as it enters and exits a lens (depending on the design of the lens). The camera lens’s job is to direct that light onto the film or sensor.

Before we go too crazy here, let me issue a disclaimer stating that there are many things one can learn about the behavior of light and the physics of lenses. I will never pretend to have more than a casual understanding of the topic, and my college physics grades would indicate that you might want to forget what you just read and are about to read but, for the purposes of this article, I am going to try to keep this basic and clear so that we can get to the subject at hand—focus. If you want to dig deeper, by all means, indulge yourself. Optics and light are super cool and fascinating, but I need to keep this relevant to the photographer. Doctoral-level knowledge of this topic is in no way guaranteed to make you a better photographer.

As anyone who has used a magnifying glass to try to burn holes in paper or leaves can attest to, there is a direct correlation between the convergence of light and distance from the object onto which you are trying to project that light. When you try to focus the light of the sun into a tiny spot to start a flame with a lens, you are focusing the light from a single light source. The camera, as well as your eye, is focusing the light from not only potentially many light sources, but an infinite number of light rays that are reflecting from objects in the scene. Moving the lens closer or farther from the sensor or film is how the camera and lens work to channel the light to recreate the image clearly.

If you could not adjust the focus of the camera and lens, you would have to move physically closer or further from the object—just like you did with your magnifying glass and the sun. Luckily for us, most cameras do the moving for us.

Let us get theoretical one more time to help cement this information. You are fundamentally against selfies and are taking a portrait of a friend so that they don’t have to take their own picture. Now, let’s look closely at our subject. Really closely… the tip of an eyelash. That eyelash tip is reflecting light from a light source (sun, strobe, light bulb, etc) in all directions, not just back at the camera. Reflected light from that eyelash is entering the camera’s lens at different angles because it is reflecting at a nearly infinite number of angles. The lens’s job is to collect those light rays and make them converge onto the film or sensor at a single point so that we can reproduce the tip of that eyelash on our photograph exactly the same as it appears to our eye. If that light converges at a point before the sensor, that eyelash tip will appear blurry, as the light will converge to a point and then continue on its merry way, diverging from the point. Similarly, if that light tries to converge at a point beyond the film or sensor, the light impacting the plane will not yet be brought to a single point, and we have the same effect.

What is this effect? An out-of-focus image is created. The tip of that eyelash is reproduced as a fuzzy collection of reflected light that will resemble a blurry eyelash tip. Now, imagine that an infinite number of times from every point of light or reflection in a scene. Blurry!

Unless your name is Hiroshi Sugimoto, you probably do not want to create out-of-focus images. Or, if you do, you will want to control how out-of-focus your images are. To allow your image to be sharp, or to allow you to intentionally not focus, the camera and lens work together to change the distance of the lens from the sensor or film in order to control where the captured light converges. When the light converges precisely at the plane of the film or sensor, the image is in focus.

So, on a camera with a lens that has a rotating mechanical focus ring, by turning this ring you will physically move the focusing lens, or lens-focusing group, to manually change the distance between the lens and sensor and allow the control of where in the camera that light converges.


Now that we have a basic understanding of how the lens works to focus the light onto the sensor or film, we can talk about the magic of autofocus. As technology advanced, camera companies figured out how to motorize the camera body and lenses to move the focusing elements or focusing group toward or away from the sensor or film. A vast majority of today’s cameras do not have autofocus motors inside the camera body, but rely on tiny motors built into the lenses, which are controlled from the camera itself.

Not really rocket science, right? But, how does the camera know when the subject is in focus? When we focus a lens manually, we look through a viewfinder or at an LCD screen and verify, with our eyes, if the subject looks sharp. Many viewfinders in the days of film had useful split-screen microprisms at the center that assisted with manual focusing. The autofocus camera needs to calculate focus electronically as the lens moves to and from the sensor or film. And, luckily for us, especially if you do not have perfect vision, it can now do this extremely fast and accurately.

Active versus Passive

You won’t see Active AF systems much these days, but let us give a nod to the technology. Active AF systems were around in the early days of autofocus technology and relied on the camera transmitting an ultrasonic or infrared signal toward the subject. The subject would reflect the sound or light back to the camera’s focus sensor and by crunching the time it took to receive the return versus the speed of sound or speed of light, the camera would know how far away the subject was. It actually sounds pretty cool and high tech, right? This is, basically, sonar and radar in a camera. Sonar and radar are cool. So is Active AF.

Before you get all excited about having pioneering technology on your camera, if you have what is known as an AF-assist lamp on your camera, its use is not an Active AF system—it merely augments lighting in a dark scene to assist the passive system.

Passive AF is the choice of the vast majority of today’s cameras. In the Passive AF world we have two different systems: Phase Detection and Contrast Detection. We will wrap up this intriguing article by describing how each system works, again, keeping it relatively simple.

Phase Detection

Phase detection is the system most commonly found on today’s DSLR cameras. As you know, light enters the lens of a DSLR and strikes a mirror that is angled in front of the sensor or film. That light is reflected up into a prism and then toward the viewfinder at the back of the camera. However, what you might not have known is that a very small amount of light passes through that mirror, strikes another mirror, and is reflected down toward the bottom of the camera, where the autofocus sensor lives.

The autofocus sensor contains two or more image sensors with microlenses above them. These tiny sensors create the camera’s autofocus points. The first passive autofocus cameras used to have one central focus point. Technology today gives us cameras with dozens of selectable focus points.

So, how does this autofocus sensor work? In simple terms, phase detection works by dividing that incoming light into pairs of images before comparing them. The light is divided as it passes through that transparent part of the main mirror, where that area acts like a beam splitter. The two distinct images are directed downward to the aforementioned autofocus sensor, where the two images are compared and their positional relationship evaluated. A computer inside the camera evaluates the signal from the autofocus sensor and commands the lens to adjust the focusing elements inside the lens until the two images appear identical. Once the two images match, the image is in focus.

Early sensors just evaluated vertical details in the image. This had its limitations as the system struggled to focus on simple scenes with lots of horizontal components. I remember turning my old SLR camera sideways to trick the autofocus sensor! Now, many sensors, called cross-type points, read both horizontal and vertical information simultaneously. Ahhhh, technology!

Contrast detection is the system used commonly by mirrorless cameras, point-and-shoot cameras, DSLR cameras in live view, and smartphone cameras; basically any camera without a mirror in use.

As you may have noticed, the phase detection systems are complex and have many components. Contrast detection is much simpler and it uses the light falling on the main sensor to provide focus. This gives contrast detection one advantage over phase detection: the number of autofocus points. With phase detection, the number of points is based on the design of the mirror and how many autofocus sensors live below that mirror. With contrast detection, the camera can have an almost unlimited number of focus points. Some modern cameras have touchscreens where the camera will focus on any point in the image that you designate, with the touch of a finger.

How does it work? Well, the camera commands the focus element of the lens to move while it reads any decrease in the intensity of light on a pixel or group of pixels. The maximum intensity indicates the region of sharpest focus. While simplicity is the advantage of this system, the downside is that the camera must constantly evaluate images in order to achieve focus. When the light hits the sensor for the first time, the camera has no idea if the light is showing its maximum intensity or not until it changes the position of the lens to vary that intensity. It is kind of the equivalent of measuring something on a balance scale without knowing the weight. You could put the counterweight on the opposite end of the scale and find that it is just right, too heavy, or too light. The camera gets the initial image, which may be in focus, but in order to verify, it has to start moving the lens to see if the image gets sharper or more blurry.

This is called “hunting.” Those who have older point-and-shoot cameras may remember, not so fondly, waiting for the lens to find focus while the action in the scene passed you by. Luckily, technology surrounding contrast detection autofocus is always improving, and today’s mirrorless cameras and point-and-shoots have the ability to focus extremely fast.

In Focus

So, now you know how focus works inside your camera. Or, at least, I hope you do.

In a follow-up segment, I will discuss the different autofocus modes and how to best use them to get the photographic results you seek. Thanks for reading!

Discussion 54

Add new comment

Add comment Cancel

Excellent note! Very clear & easy to understand! Thanks!

Thanks, juanba! Glad you enjoyed it!

Great article. can't wait for the next one. 

Thanks for reading, christian!

I found this articel very interesring and helpful.   

Thanks for reading, Spike!


The scientific aspect of this article is so beautifully presented, I am guessing you must have worked hard on editing the discussion. I happen to do similar tricks with ultrasound waves (beam-forming) for my PhD thesis, so it further kept me groved in. Currently, I am using a SONY a7ii, if you get a chance to discuss some of its auto-focusing and stability mechanisms it will be great; there isnt much literature on mirrorless cameras. I have also used Sony a6000 for a long time, which has the reputaion of being the fastest auto-focusing camera with 11 frames per second, I hope you will cover some of its auto-focusing tricks in your next article.

Very good job, keep it up. Kudos.


Hi Rohit,

Thanks for your comments!

As far as focusing on your a7II is concerned, this is what we have on our sales page for the focusing system:

Enhanced Fast Hybrid AF
Utilizing 117 phase-detection and 25 contrast-detection autofocus points with a wide area of coverage, the a7II can smoothly and quickly track fast-moving subjects throughout the frame. It optimizes for both speed and accuracy with an enhanced algorithm that improves performance by about 30% when compared to previous generations. This just developed algorithm will also more accurately predict subject movement for tracking that is 1.5x more accurate. Additionally, it can capture images at a rate of 5 fps while using continuous autofocus and automatic exposure. This can be captured in a burst of up to 77 frames when shooting in JPEG Fine L format and a continuous AF Display allows users to view the active AF points. 

Another feature available with this AF system is a Lock-on AF tracking that will analyze more information from the scene to provide dramatically improved accuracy and stability. Eye AF is also available which will prioritize a subject's pupil for excellent portraits even with a shallow depth of field.

I will definitely look into an article on image stabilization systems for a future Explora piece. Thank you very much for your compliments! See you next time!

I've been using cameras for years, and always had a good understanding of manual focus. Autofocus, particularly the difference between Phase Detection and Contrast Detection were always a bit of a mystery. Thanks for clarifying!

No worries, Henry! Thanks for reading!

Wow!  An exemplary explanation with supporting animation to make things clearly focused in understanding.  Congratulation of the effectiveness with which you delivered  it all...


Thank you very much and thanks for reading!

Good Job and good to know.  This will come in handy.

Thanks andRegards

Thanks, H Tyree! Glad you enjoyed it!

"This gives contrast detection one advantage over phase detection"

Certainly not the most important as autofocus accuracy is significantly improved over phase detect which has to assume that all the mechanical components are perfectly aligned. Of course, none of them are perfectly aligned but might be good enough, depending on the quality standards of the photographer. Hence we have autofocus correction technology on the better DSLRs which opens another can of worms. 

A friend just had her wedding "professionally" shot and all the images are backfocused significantly. Her whole wedding is out of focus thanks for a poorly skilled photographer. 

Always check your new camera in Live mode AF and compare it to the Viewfinder AF mode.  Set your camera on a tripod. Open the lens to the widest apeture.  Place three focus targets on the wall in a horizontal line and center your camera. Position the AF target over the left most target. Do the same for the Center and Right target. Now do the same in the Live View mode.  Compare the results. If the Live view mode is sharper than the View finder AF mode, you have a problem. Do not assume that because you just spent 3-10K on the latest and greatest camera that you won't have this problem. You would be suprised at how many cameras have this issue. You don't want to be "that guy" who delivers back focused images. That is my tip for the day. 

Hey JV,

Great tip. Testing autofocus is a good thing to do. Fortunately, I have never had an issue with my autofocus, but I do know it happens. Always check your images and if you consistently are not getting sharp photos, you need to take a critical look at both your gear and your process.

I hope you make the varsity squad soon!

I had an AF failure on my Nikon D3s. 

Hey Pat. Sorry to hear about your AF failure. Did you have it repaired? Or was there a way to calibrate it yourself?

Hello TwoMetreBill,

You make a great point, sir, and I agree with you. I chose not to dive into the autofocus correction topic in this segment as I felt that would take us down a bumpy road towards the can of worms. 

Sorry about your friend's wedding photos. We have some wedding articles coming up and one thing that many wedding pros told us was that you need to check, test, and re-check your gear. Yikes. Tough break. 

Thanks for reading!

Really glad to see this article and being in the process of reading it. Focusing seems like somewhat of a neglected subject so I appreciate what seems to be an excellent approach, one that's accessibe to the ardent readers of this website.

Thanks, David! I hope you still enjoyed the piece after you kept reading!

I'm impressed, and would love to read about the different focus modes.

Hey Michael,

Focus mode article coming soon! Stay tuned! Thanks for reading!

Coincidence that on the same day as I got your email and this interesting article my email from DP Review had an article about software that adjusts the accuracy of autofocus on Canon and Nikon cameras. I may have to go back to a box Brownie !!

Hi Eric,

Ha! Honestly, maybe not a bad idea there! Remember the days where you just shot a roll of 24, dropped it off, picked it up, and enjoyed your prints? No computers, no firmware, no software, no late nights editing...yikes. I think you may be on to something!

Thank you Todd and great reading & easy understanding such a technical issues. I am a user of Nikon 5100 along with Nikon lenses 28-70 & 28-300. Frankly I am not totally happy with the shrpness though focusing is well accepted especially while blowing up the image comparing with pictures taken on film. Will appreciate once you have chance to enlighten us on picture sharpness of digital cameras. Kind regards 

Hi Ahmed,

My advice to you is to do a controlled test of your gear. Check out this guide: How to Test Your Lens. If you are still not getting sharp results (or acceptable sharpness), then you might need to have your gear checked out.

Sharpness is a bit subjective, honestly. I will try to think of a way to capture that in an article in the future. 

Thanks for reading!

Very interesting.   Complete & Simple.

Thank you, Royo! Glad you enjoyed it!

ThanksTodd Vorenkamp  for the lesson.  Looking forward to the next one.

B&H Customer./Rgds/thana

You are welcome, thana yakul! Thanks for reading!

I use a Pentax K20D that is probably 6 years old and many times when using autofocus the camera seems to be hunting for the correct image. Now I understand why and what to do to improve the situation.

Glad to be of assistance, Eric! Thanks for reading!

Nothing beats a writer who can make complex topics simple. It's not an easy task -nice job! I'm looking forward to your other articles.

In fact, where can I find them?

Hi unclegeo! Just type my name into the Explora search box and you should get a list of articles that I penned (plus some random stuff too...probably!). Let me know if it doesn't work!

Thanks, uncelego! I appreciate the comment! Thanks for reading!

Muy ***** el articulo. Muy clara y simple la explicación espero recibir la próxima muy pronto


Gracias, guillermo! Agradezco sus comentarios. El siguiente artículo va a salir pronto.

It looks like an easy concept but you guys explin it on detail. I will love to read more articles like this,like for better understanding on the principles of photography. I know there is a lot to learn. Thx

Thank you, Juan! I have written a lot of informative articles recently. Just drop "Todd Vorenkamp" into the blog search bar and you will see a list. Soon we plan on having links to these articles available in one place. Thanks for reading!


I enjoyed the article, but there's something I still don't get about your eyelash example. You say "Reflected light from that eyelash is entering the camera’s lens at different angles because it is reflecting at a nearly infinite number of angles". But, if the light source is basically a point (eg. the sun), and the tip of the eyelash is basically a point, and the lens of the camera is relatively small, I don't get the "reflecting at a nearly infinite number of angles" part. Is it because the lens is not a point and the light of the sun reflected on the tip of the eyelash enters different parts of the lens at different angles? If so, is that the reason why smaller apertures of the diaphragm of the camera produce different depths of filed? Please clarify. Thanks.

Hey Pablo,

Thanks for your question. Here is my attempt at clearing up your confusion:

If they eyelash only reflected light in one direction, you could only see the eyelash from a single position. As it is, the eyelash reflects light in all directions, that is why you can see it as you move around the person or that person moves around you. The only time you lose sight of the eyelash is when another object blocks the light from said eyelash.

When it comes to light, the diagrams work to greatly simplify the light rays reflecting from an object, entering and being diffracted by a lens, and then being focused on a sensor. In reality, there are innumerable light rays reflected in innumerable directions traveling towards the camera. It is amazing that we can invent lenses (and have lenses mounted on our heads) that can focus all these random light rays into a coherent image. It boggles the mind!

Depth of field is somewhat related, but that is a different function of aperture and focus and not just focus. I am going to be publishing an in-depth depth of field article soon. Stand by! 

Thanks for reading and thanks for your question!

Something that may help illustrate if your computer's sound has an effects processor... Find a "click" type sound like maybe a ticking clock.  Go into the effects processor and add echo.  Play with the settings and you'll end up with  "TICK...Tick...tick"  Next change from echo to reverb, and you'll hear "Tiiiiicccckkk."  Think of the reverb as similar to an out-of-focus picture.  It's really an infinite number of echos that blend together, and the out-of-focus picture is an infinite number of image convergances.

Thanks, Chuck! Great analogy! 

Glad to see you writing on this. For me, optical science is the last bit about camera that I could not easily and fluidly educate others on, and therefore I am doing my best to learn. It's one thing to understand refraction in a simple single lens system, once you add multiple light elements, then beam splitters or mirrors, and then auto focus systems - it get wildly intriguing and complicated. I appreciate the choices you made in your presentation.

For those further interested, the Massachusetts Institute of Technology has a great free video lecture series available that is part of their Optics course. 

Also I have found an excellent app for iPhone called Ray Lab where you can sample, edit, and create lens systems and see refractive patterns as you edit the elements.  

Hey Cameraplex!

Thanks for reading and thanks for commenting! I am glad you enjoyed the article. Thanks also for the links and info!

Optics and light are really intriguing topics that I wish I could dive deeper into. However, I definitely make the choice to try to tell photographers only what they need to know to understand the relationship of these topics to making photos. I am glad you appreciated the approach! Thanks!

Thanks for a well written article.  I really needed that. 

Hey Claude,

You are very welcome! I am glad you enjoyed it! Thanks for reading!