Highly sensitive gas sensors play a crucial role in monitoring the concentration of harmful gases within automobile interiors, ensuring the well-being of occupants. In this study, a computational approach employing density-functional theory was utilized to investigate the gas-sensing performance of twodimensional WS 2 nanomaterials doped with precious metals (Au, Ag, and Pt), particularly in the detection of hazardous gases such as formaldehyde (HCHO) and hydrogen sulfide (H 2 S). The research findings indicate that the introduction of precious metal dopants significantly enhances the sensitivity of WS 2 to both H 2 S and HCHO gases, concurrently improving the material's electronic properties and stability. Furthermore, metal doping into the WS 2 system induces a more pronounced electron transfer during the adsorption process with target gases, thereby further augmenting the intrinsic sensitivity of WS 2 to the target gases. Considering the desorption performance of gases, Ag−WS 2 emerges as a promising candidate for detecting HCHO and H 2 S at room temperature. Au−WS 2 , which is stable in adsorbing HCHO at room temperature and rapidly desorbing at elevated temperatures, presents itself as a potential material for efficient and reusable HCHO sensing at high temperatures. These research findings provide unique insights and directions for the development of efficient and sensitive gas sensors, offering robust support for addressing issues related to environmental monitoring. By delving into the gas-sensing performance of two-dimensional WS 2 nanomaterials under different metal dopings, this study contributes valuable references for the design of innovative sensor materials and technologies.