Single (AF-S) for still subjects, continuous (AF-C) for moving ones
Portraits
Focus on the nearer eye as a rule
What focus is
A lens can focus exactly on only one plane at a given distance. Moving forward or back from that plane, points spread into slightly larger circles and become blurred. But when those circles are small enough, they look sharp to the human eye, so a range that appears sharp forms in front of and behind the focal plane. This range is the depth of field. Because it depends on a standard for how much blur counts as blurred, the same photo looks shallower when printed large or enlarged.
What changes depth of field
Depth of field is set by the factors below together. If you want a blurred background, pushing several factors in the same direction strengthens the effect. The distance between subject and background also matters: with the same settings, a farther background looks more blurred. When everything from front to back must be sharp, as in group photos or landscapes, adjust the factors in the opposite direction.
Aperture: smaller f-number, shallower
Shooting distance: closer to the subject, shallower
Focal length: longer at the same distance, shallower
Distance to background: farther background looks more blurred
Sensor size and depth of field
Shooting the same scene with the same angle of view and the same f-number, a camera with a larger sensor gives shallower depth of field. That is because a larger sensor needs a longer focal length to get the same angle of view. Smartphones have small sensors and lenses with short actual focal lengths, so they tend to render everything sharp. Smartphone portrait modes compensate by calculating depth information and blurring the background in software. That is why awkward blur sometimes appears around complex edges such as hair or glasses.
Autofocus modes
Camera autofocus comes in two main types. Single autofocus focuses once when you half-press the shutter and then locks. Depending on the maker it is called AF-S or One Shot AF, and it suits still life and people standing still. Continuous autofocus keeps refocusing while you hold the half-press, and is called AF-C or AI Servo. Use it for subjects whose distance changes, such as running children, pets and sports.
Choosing the focus area
You can also choose how the camera decides where to focus. Fully automatic area selection is convenient but tends to jump to near objects or high-contrast spots. To focus exactly where you want, choose a single point or a small zone and move it onto the subject. Many recent cameras and smartphones automatically find and track faces, eyes and animal eyes, which has made people and pet photography much easier. For portraits, focusing on the eye nearer the camera is the rule.
Manual focus and hyperfocal distance
Manual focus works better when autofocus hunts: in the dark, on low-contrast scenes, or through a wire fence. Many cameras have focus peaking, which colors in-focus edges, and a magnified view to help with manual focus. Landscape photography uses the idea of hyperfocal distance. If you focus at that distance, everything from about half that distance to infinity falls within the depth of field. The hyperfocal distance depends on focal length, aperture and the blur size used as the standard, so use a calculator app or a lens table.
Common reasons focus misses
When a photo is blurry, first tell whether the cause is focus or shake. If something in the frame is sharp but the part you wanted is soft, it is a focus problem; if everything is smeared in one direction, it is shake. For focus problems, check the causes below. Getting into the habit of zooming in to check lets you reshoot on the spot.
You got closer than the lens's minimum focus distance
Automatic area selection picked the background or a foreground object
You focused and then recomposed at a wide aperture
You shot a moving subject with single autofocus
Autofocus hunted on a dark or featureless surface
Using depth of field expressively
Depth of field is a tool for guiding the viewer's eye. Shallow depth tidies a busy background and makes the main subject stand out, so it is common in portraits, flowers and food. Deep depth suits landscapes and street photos that show information about the whole scene. A blurred object placed slightly in the foreground adds a sense of depth. Blurring the background as much as possible is not always better, so consider whether the background tells the viewer where you are, and choose the amount accordingly.