A phase retrieval algorithm, developed and implemented by Perkin-Elmer, is used as a technique for in-orbit alignment of the optical system in NASA's Space Telescope. Reasonably accurate estimates of wavefront aberrations are obtained from measurements of the system point spread function (PSF). Further, the accuracy of the estimates increases as the magnitude of the aberrations decreases. Therefore, even if initial aberrations are large and result in crude estimates, a partial correction of the system can be made. A reapplication of the algorithm to the improved PSF will yield more accurate estimates of the uncorrected aberrations. In this fashion, a few iterations of the phase retrieval algorithm will allow perfect system correction from an aberrated state. The algorithm consists of initially defining an error function. The goal is to minimize the error function with respect to a set of parameters. Using Zernike polynomials to describe the phase in the pupil, we are able to write an analytic expression representing the PSF. An error function that can be minimized with respect to the coefficients of the Zernike polynomials is then calculated.