With the availability of high-resolution miniature spatial light modulators (SLMs) new methods in optical microscopy have become feasible. The SLMs discussed in this review consist of miniature liquid crystal displays with micronsized pixels that can modulate the phase and/or amplitude of an optical wavefront. In microscopy they can be used to control and shape the sample illumination, or they can act as spatial Fourier filters in the imaging path. Some of these applications are reviewed in this article. One of them, called spiral phase contrast, generates isotropic edge enhancement of thin phase samples or spiral-shaped interference fringes for thicker phase samples, which can be used to reconstruct the phase topography from a single on-axis interferogram. If SLMs are used for both illumination control and spatial Fourier filtering, this combination for instance allows for the generalization of the Zernike phase contrast principle. The new SLM-based approach improves the effective resolution and avoids some shortcomings and artifacts of the traditional method. The main advantage of SLMs in microscopy is their flexibility, as one can realize various operation modes in the same setup, without the need for changing any hardware components, simply by electronically switching the phase pattern displayed on the SLMs.