NEWMOD©, developed by R.C. Reynolds, Jr., has been an important tool for evaluating quantitatively X-ray diffraction (XRD) patterns from interstratified clay minerals for more than 20 years. However, a significant drawback to the NEWMOD© approach is that analyses are done by forward simulation, making results sensitive to user input and starting-model assumptions. In the present study, a reverse-fitting procedure was implemented in a new program, FITMOD, which automatically minimizes the differences between experimental and simulated XRD patterns. The differences are minimized by varying model parameters (such as Reichweite, crystal-size distribution, cation content, type of disorder, etc.) using the downhill simplex method. The downhill simplex method is a non-linear optimization technique for determining minima of functions. This method does not require calculation of the derivatives of the functions being minimized, an important consideration with many of the parameters in NEWMOD-type simulations. Instead, the downhill simplex method calculates pseudo-derivatives by evaluating sufficient points to define a derivative for each independent variable. The performance of FITMOD was evaluated by fitting a series of synthetic XRD patterns generated by NEWMOD+, yielding agreement factors, Rwp, of <0.3%. As long as the correct interstratified system was specified (e.g. illite-smectite), excellent fits were obtained irrespective of the starting parameters for the simulations. FITMOD was also tested using experimental XRD patterns, which gave very good fits, in agreement with previously published results. The optimization routine yields good fits for both synthetic and experimental XRD profiles in a reasonable time, with the possibility of varying all important structural parameters. FITMOD automatically provides optimum fits to experimental XRD data without operator bias, and fitting efficiency and accuracy were, therefore, significantly improved.