Fifteen samples of No. 4 coal from the Yongdingzhuang Mine in Datong Coalfield were tested for their elemental compositions, modes of occurrence, and mineralogical compositions, using X-ray powder diffraction, X-ray fluorescence spectrometry, inductively coupled plasma mass spectrometry, and scanning electron microscopy equipped with an energy-dispersive X-ray spectrometer. The samples have low sulfur content (0.63%). The major minerals are kaolinite and quartz, followed by pyrite and anatase. Compared with averages for the Chinese coals, the percentages of SiO2 (15.11%), TiO2 (0.7%), and Al2O3 (10.39%) are much higher. In No. 4 coals, Li (62.81 μg/g), Be (6.94 μg/g), Zr (235 μg/g), Ga (17.04 μg/g), F (165.53 μg/g), Tl (1.93 μg/g), and Hg (0.34 μg/g) are some potentially valuable and toxic trace elements with higher concentrations than Chinese coals and World hard coals. Lithium and F mainly have kaolinite associations. With the exception of kaolinite, Li, and F also partly occur in anatase, gorceixite and goyazite. Beryllium largely occurs in anatase; gallium is mainly associated with kaolinite and to a lesser extent, with gorceixite and goyazite; zirconium is associated with kaolinite, gorceixite and goyazite; and thallium and Hg occur in in pyrite. Potentially valuable elements (including Al, Li, Ga, and Zr) might be recovered as value-added byproducts from coal ash. Toxic elements (e.g., Be, F, Tl, and Hg) might have potential adverse effects to the environment and human health during coal processing. In addition, the distribution patterns of rare earth elements and yttrium (REY) indicate that the REY in No. 4 coals originated from the granite of Yinshan Oldland, and natural waters or hydrothermal solutions that may circulate in coal basins.