Mathematical relationships between unit-cell parameters and chemical composition were developed for selected mineral phases observed with the CheMin X-ray diffractometer onboard the Curiosity rover in Gale crater. This study presents algorithms for estimating the chemical composition of phases based solely on X-ray diffraction data. The mineral systems include plagioclase, alkali feldspar, Mg-Fe-Ca C2/c clinopyroxene, Mg-Fe-Ca P2 1 /c clinopyroxene, Mg-Fe-Ca orthopyroxene, Mg-Fe olivine, magnetite, and other selected spinel oxides, and alunite-jarosite. These methods assume compositions of Na-Ca for plagioclase, K-Na for alkali feldspar, Mg-Fe-Ca for pyroxene, and Mg-Fe for olivine; however, some other minor elements may occur and their impact on measured unit-cell parameters is discussed. These crystal-chemical algorithms can be applied to material of any origin, whether that origin is Earth, Mars, an extraterrestrial body, or a laboratory.