A method has been developed for quantitative analysis of all major sulfur forms in coal, both organic and inorganic, from sulfur K-edge X-ray absorption fine structure (XAFS) spectroscopy. The method is based on least-squares analysis of the X-ray absorption near-edge structure, or XANES, into a series of peaks that represent 1s --> np photoelectron transitions. Because the major sulfur forms occurring in coal (pyrite, organic sulfide, thiophene, sulfoxide, sulfone, and sulfate) have characteristic s --> p transition energies, the relative peak area contributed to the XANES by each sulfur form can be determined. These peak areas are converted to weight percentages of sulfur by using calibration constants derived from XANES data from standard compound mixtures. This method has been applied to determine the sulfur forms in the Argonne Premium Coal Sample Bank (APCSB) coals, a number of additional whole coals, and a suite of maceral separates from coals of various ranks. Several interesting trends are observed: (1) the organic sulfide content is generally observed to increase with decreasing rank, although thiophenic sulfur is normally the dominant organic component, regardless of rank; (2) exinite macerals consistently exhibit a higher organic sulfide percentage than vitrinite or inertinite; (3) sulfur-oxygen bonded phases increase with decreasing rank for the maceral separates; and (4) good agreement is observed between pyritic sulfur content determined from XANES analysis and that measured by Mossbauer spectroscopy.