A simple algorithm is presented for processing digitized x-ray spectra obtained with a si(li) or ge(li) semiconductor detector coupled to a multichannel analyzer. The simplified least-squares procedure is used to smooth out the statistical fluctuations in the spectrum by repeatedly fitting a quadratic equation to a predetermined number of channels and performing a traveling smooth across the spectrum. A logarithmic transform is applied to the raw data to minimize the distortion of the Gaussian-shaped peak profiles. The efficacy of the technique is evaluated by observing the distortion of several Gaussian-shaped peaks that have been subjected to the smoothing operation. The locations of maximums and minimums in the spectrum are predicted in the process as well as the values of the peak heights. The convolution integers from a least- squares fit of a quadratic equation are calculated as part of a Fortran subroutine. The building-block approach to computer programing in a small laboratory is discussed.