A new automatic method for quantitative mineralogical analysis of carbonate sediments by X-Ray diffraction is described. Percentage analysis has been carried out by means of the reference intensities method from integrated areas of the diffraction peaks. Diffraction peaks were fitted by means of Lorentzian profiles. The addition of an internal standard allows the determination of data on the stoichiometric disequilibrium of the carbonate phases and the existence of non-carbonate phases and/or non-crystalline phases simultaneously. Relative errors of the quantitative estimates of carbonate phases are always less than 15%, even though real percentage differences between actual and calculated values are less than 3·8% in all cases.