PIXEF (for PIXE-fit) is a proton-induced X-ray emission (PIXE) data analysis program designed for analyzing medium to heavy element matrices while retaining the capability to treat lower atomic number targets. Using nonlinear least squares fitting techniques, algorithms have been developed or modified for both fitting the characteristic X-ray peaks and representing the associated bremsstrahlung and gamma-ray background. Self-absorption and secondary fluorescence are explicitly determined for K-shell and L-subshell X-rays. Data bases have been created or improved, where necessary, from reliable current literature values or by direct measurement for element mass attenuation coefficients, photoionization and proton ionization cross sections, Coster-Kronig transition probabilities, fluorescence yields, and relative line intensities. The utility of the program is demonstrated with PIXE spectra obtained at Livermore.