Autofocus (AF)

Autofocus, or AF, is the system that moves the lens elements until the subject you chose is sharp, without you turning the focus ring. You aim an AF point at something, half-press the shutter button (or press a back-button), and the camera measures where focus currently falls and drives the lens to correct it.

Two ways a camera judges focus

Phase detection compares the light arriving from two sides of the lens. If the two views do not line up, the camera knows both how far out of focus the subject is and which way to move, so it can go straight to the right spot. DSLRs use a dedicated sensor for this, and most mirrorless cameras build phase-detect pixels into the main sensor.

Contrast detection looks at the image itself. A sharp subject has strong differences between neighbouring pixels, so the camera moves the lens until that difference peaks. It does not know which direction to go at first, so it nudges and checks, which can look like hunting. It is accurate but generally slower.

Most modern cameras combine the two. Phase detection makes the quick, large move, and contrast detection confirms the final result.

Focus modes

  • Single (AF-S, One-Shot): focuses once and locks while the button is held. Good for still subjects.
  • Continuous (AF-C, AI Servo): keeps refocusing as long as the button is held. Use it for anything that moves toward, away from or across the camera.
  • Automatic (AF-A, AI Focus): lets the camera choose between the two. It is convenient but can guess wrong, so many photographers avoid it.

Choosing where it focuses

You can select a single point, a small zone, or let the camera pick from the whole frame. The more the camera decides, the more it tends to grab whatever is closest or has the most contrast, which is not always your subject. Newer cameras add subject recognition for faces, eyes, animals, birds and vehicles, and can follow a recognised subject across the frame. Eye detection in particular makes portraits at wide apertures far more reliable.

When it struggles

Autofocus has trouble with dim light, flat or featureless surfaces such as a blank wall or clear sky, repeating patterns, strong backlight, and subjects behind fences or foliage that sit between you and the target. Moving to a point on a high-contrast edge, adding light, or switching to manual focus usually solves it. Separating focus from the shutter button with back button focus gives you more control.

A sharp result also depends on a shutter speed fast enough to freeze both subject and camera movement. Focus can be exactly right and the frame still blurred.

Want to see how these systems work in detail, and how to set them up for different subjects? How autofocus works explains the mechanics step by step.