A real‐time method for optimizing the defocus of a conventional transmission electron microscope in the phase contrast imaging mode has been investigated using image histogram data. This method can also be used to minimize the objective lens astigmatism. It will be shown both theoretically and empirically, using a digital television frame store, that a histogram will give the largest peak when an image has a broad and flat contrast transfer function. This method has distinct advantages of speed and minimal computational requirements over obtaining the power spectrum of an image. Copyright © 1985 Wiley‐Liss, Inc.