The study on the origin of quartz and silica in Xuanwei Formation coal in Northwest Yunnan, China, is helpful to understand the relationship between quartz and silica and the high incidence of lung cancer from the root. To address these questions, the mineralogy and microscopic studies of silica in Xuanwei Formation coal were performed.The following results were obtained: (1) silica in the late Permian Xuanwei Formation coal seams originated from detrital input, early diagenesis, and late diagenesis. (2) A more signi cant contribution comes from early diagenesis, which contains abundant authigenic quartz and amorphous silica. (3) Quartz and silica from inorganic silicon are more symbiotic with kaolinite and from biogenic silicon with chamosite. (4) Three silica polymorphs in coal samples have been identi ed: opal-A (amorphous silica), opal-CT/-C (cristobalite/tridymite), and α quartz. ( 5) Opal-A is ubiquitous, while opal-CT/-C and α quartz are rare. (5) Opal-A is an amorphous and nontoxic ordinary silica. Highlights 1. Silica originated from detrital input, early diagenesis, and late diagenesis.2. Early diagenetic silica contains authigenic quartz and amorphous silica.3. Inorganic silica is more symbiotic with kaolinite and biogenic silica with chamosite. 4. Opal-A is ubiquitous, while opal-CT/-C and α quartz are rare. 5. Opal-A is an amorphous and nontoxic ordinary silica.