Photography Tutorial:

F-Stop (Aperture) Setting and the Affect on Depth of Field

One of the principal effects of reducing the aperture size (increasing F-stop value) is a radical increase in the depth of field in the resulting photograph. To get as much in front of you in focus as possible, use a smaller aperture. If you wish to isolate a subject, use a larger aperture. This will blur both the foreground and background.

Mouse over each link to see the Depth of Field (DOF) changes. 50mm shots taken with Nikon 50mm D F/1.8. 85mm shots taken with Nikon 85mm D F/1.8.

50mm Lens --> F/1.8 F/2.8 F/4 F/5.6 F/8 F/11   F/22
85mm Lens --> F/1.8 F/2.8   F/5.6   F/11 F/16  

However, if you go with too small of an aperture trying for the greatest depth of field you can end up reducing the quality of the resulting image due to an optical principal called, difraction. When light waves pass through a very small opening, those light waves passing near the edge of the opening tend to get slightly deflected in their path, resulting in a loss of sharpness in the photograph.

In general, when shooting non-macro photos, try to keep the F-stop at F/16 or lower .. F/11 or lower is even better. Generally speaking, the sharpest setting for any non-macro lens is one to two stops down from the lens maximum. A F/2.8 lens is sharpest at F/4 or 5.6 .. An F/4 lens is sharpest at F/5.6 or 8, etc.

Only the focal length of the lens and the aperture being used affect the resulting depth of field. How well you isolate a subject from the foreground and background depend upon the focal length of the lens in use, the aperture selected, the distance from you to the subject and from the subject to items behind it.

You can try various focal lengths and F/stops here: DOFMaster

Pay attention to the resulting values for Near limit (nearest point for objects in focus), Far limit (furthest point for objects in focus) and not just the Total.