An array-type universal profile function for powderpattern fitting is described. It is defined as an array of unknown parameters representing the profile heights at discrete angular steps. The unknown parameters are determined during least-squares fitting together with the integrated intensity, the peak position, the peak width and background parameters. The function has been applied to profile fitting in a small 20 range, and has better R factors than the pseudo-Voigt and Pearson VII functions. This new function has some important advantages: it can model any complex profile shape, which would be difficult to describe by a smoothly varying analyticaltype function; it generally gives a better fit and thus more precise and accurate analysis than currently used analytical-type functions; and it can be applied to the data of all radiation sources including conventional X-rays, synchrotron radiation and time-offlight and fixed-wavelength neutrons without changing the mathematical form. The optimized use of the function and the accuracy of deduced parameters are also discussed. © 1990 International Union of Crystallography.