Photochemistry-based silica formation offers a pathway toward energy-efficient and controlled fabrication processes. While the transformation of poly(dimethylsiloxane) (PDMS) to silica (often referred to as SiOx due to incomplete conversion) under deep ultraviolet (DUV) irradiation in the presence of oxygen/ozone has experimentally been validated, the detailed mechanism remains elusive. This study demonstrates the underlying molecular-level mechanism of PDMS-to-silica conversion using density functional theory (DFT) calculations. Our findings reveal that atomic oxygen plays a key role in converting PDMS to silica by catalyzing the replacement of -CH3 groups to -OH groups, with a barrier-less insertion into Si-C and C-H bonds, eventually leading to condensation reactions that produce silica and formaldehyde and/or formic acid as byproducts. The proposed molecular pathway has further been validated through controlled experiments, which confirm the successive -CH3 to -OH replacements and identify gaseous byproducts such as formaldehyde. These findings offer insights into the fundamental processes involved in photochemistry-based silica fabrication and could pave the way for advancements in energy-efficient materials synthesis.