The short answer
For most landscapes on a full-frame camera, start around f/8 to f/11. That range usually gives enough depth to keep foreground and distance acceptably sharp, while staying clear of the softness that can appear at very small apertures. Focus with care, check the near edge of the frame, and adjust from there.
Why landscapes usually use a narrow aperture
Landscapes often have objects at many distances in the same scene: rocks or grass close to the camera, a river or path in the middle, and hills or sky far away. A narrower aperture gives a deeper zone of sharpness, so more of those layers can be acceptably sharp in one frame.
A wide aperture, such as f/2.8, gives a thin zone that might keep only the middle distance sharp. That can be useful for an isolated subject, but it is usually the wrong choice for a broad view.
Why not always the smallest aperture
It is tempting to stop down to f/22 for maximum depth. Many lenses do not produce their best detail at that setting. Light bends slightly as it passes through a small opening, which is called diffraction. The effect spreads the light and softens the image.
On many full-frame cameras, diffraction becomes visible somewhere around f/11 to f/16. On smaller sensors, the point comes at a wider aperture. The exact threshold depends on the sensor, the lens and how large you print or view the image, so treat these figures as a guide rather than a fixed rule.
Choosing between f/8, f/11 and f/16
- f/8: often the sharpest setting for many lenses, with a reasonable depth for many scenes.
- f/11: a common choice for landscapes with a near foreground and a distant horizon. It gives more depth than f/8 with only a small loss in sharpness on many lenses.
- f/16: use this when you need the extra depth and the scene can stand a little softness, or when you have tested your lens and found it holds up.
Test your own lens if you can. Shoot the same scene at f/8, f/11 and f/16, then look at the distant details and the corners at full size.
Pair the aperture with focus placement
The aperture alone does not decide the depth. Where you focus matters as well. The zone of sharpness reaches farther behind the focus point than in front, so a common approach is to focus about a third of the way into the scene.
For the most depth at a given aperture, hyperfocal focusing sets the focus distance so that the zone runs from about half that distance to infinity. The article on hyperfocal distance explains the number and how to find it.
Wide lenses and a foreground
A wide-angle lens gives more depth than a longer lens at the same aperture when the framing is similar. A wide lens also lets you include a close foreground, such as a rock, a flower or a patch of water, while keeping the distant scene in view.
Get close to the foreground object, but not too close. A very near object can fall outside the zone even at f/11. Look at the bottom edge of the frame on screen before you release the shutter.
Shutter speed and ISO with a narrow aperture
A narrow aperture lets in less light, so you may need a slower shutter speed or a higher ISO. A tripod helps when the shutter speed gets slow. Use a remote release, a timer or your camera’s electronic shutter if vibration is a concern.
Moving water and wind-blown plants will show motion blur at slow speeds. This can look pleasing, but if you want them sharp, you may need a higher ISO or a different aperture.
When you need focus stacking
Some scenes have a foreground that is too close for any reasonable aperture to hold sharp, especially with a longer lens. In that case, shoot several frames focused at different distances and blend them in software. This is called focus stacking. It works best when the scene is still, so use a tripod and avoid moving elements.
For a landscape with still foreground and distant elements, focus stacking can keep both sharp without stopping down to a diffraction-soft aperture.