The effect of axial misalignment of the detector pinhole in confocal microscopes is investigated. We find that the use of a flat mirror to determine the axial position of the pinhole in a reflection microscope does not necessarily give the correct location. However, for a fluorescent microscope there is no uncertainty in determining the axial position of the pinhole by maximizing the fluorescence signal from a thin fluorescent film.