The surface roughness of polished glass substrates and optical thin-film coatings is studied with atomic force microscopy and x-ray scattering. It is demonstrated that both methods permit the determination of power spectral density functions in a wide range of spatial frequencies. The results are in good quantitative agreement.