Automatic techniques have not been applied in the geochemical discrimination of marine, terrestrial and hydrothermal cherts, which is critical to retrieving the paleoenvironmental information of ancient sedimentary basins. Here, we applied three supervised machine‐learning methods to analyse the labelled geochemical compositional data (32 major and trace elements) of cherts, including the support vector machine (SVM), sparse multinomial regression and linear discrimination analysis. Our results show that these machine‐learning methods can successfully discriminate different chert types, as the lowest classification score is 79%. Among the methods, the SVM is the most powerful approach (classification score 88%, on average), even though it is hard to be geochemically interpreted. Sparse multinomial regression and linear discrimination analysis are also efficient approaches (mean classification score 84%), which can be used to extract the important elements and the most representative sample for each chert type. Especially, the linear discrimination analysis can construct binary discrimination diagram superposed with biplot rays and posterior probability‐based decision boundaries, which could be quickly applied and explained by other researchers. Furthermore, the successful discrimination of different chert types indicates that cherts derived from different silica sources have different geochemical signatures, albeit mixing between different sources of silica during chert formation is common. Last, the general geochemical features of each chert type were summarised based on geochemical information extracted by machine‐learning methods and previous geochemical studies.