With the aim of better understanding geochemistry of coal, 416 borehole samples of coal, one parting, two floor and two roof mudstones were collected from 9 minable coal seams in 24 boreholes drilled during exploration in the Huainan Coalfield, Anhui, China, and 47 elements were determined by various analytical techniques. The depositional environment, abundance, distribution, and affinity of elements were investigated. Results shown that the boron concentration in the coals indicates a brackish water depositional environment in this study region and marine influence decreased from coal seam 1 to 13-1. Some potentially toxic elements (e.g., Se, Cd) are higher than their averages for Chinese coals. The roof, floor and parting samples have higher contents of some elements than do the coal seams. The minerals in the coals from the Huainan Coalfield were found to consist mainly of clays, carbonates and sulfides. The elements can be classified into two groups based on their stratigraphic distribution from coal seam 1 to 13-1, and the characteristics of each group are discussed in detail. The elements may be classified into four groups (i.e., Group 1 to 4) according to their correlation coefficients with ash yield. The elements in Group 1, Group 2, and Group 3 are strongly correlated with ash yield, while the elements in Group 4 have weak or negative correlation coefficients.