An automatic ellipsometer that uses a four-detector photopolarimeter (FDP) to measure the state of polarization of light reflected from an optically isotropic or anisotropic, depolarizing or nondepolarizing sample surface is described. For conventional ellipsometry on specular isotropic surfaces, the incident light is polarized (at least partially) in one stable state (e.g., using a linear polarizer that need not be perfect), and the reflectance and ellipsometric parameters of the surface are encoded onto and, hence, can be retrieved from, the Stokes parameters of the reflected light. The latter are measured, virtually instantaneously, by the FDP. The FDP also greatly simplifies generalized Mueller-matrix ellipsometry on anisotropic or nonspecular surfaces. In this case, the polarization ofthe incident light is controlled by a linear polarizer followed by a quarterwave retarder (QWR) with a rotationally adjustable fast axis azimuth C. Fourier analysis of the output current vector of the FDP as a function of C yields a series of five terms whose vectorial coefficients determine the Mueller matrix column-by-column. In such an analysis, we account for the small inevitable imperfections of the QWR. Results are presented for measurements at the 633-nm wavelength of the ellipsometric parameters of a Au surface and the zeroth-order Mueller matrix of the 1200 G/mm Alcoated holographic grating for three different orientations of the grooves relative to the plane of incidence.