HCN, ClCN, H2S and SO2 pose signifcant health risks to humans. The utilization of high-precision nanomaterials and nanosensors enables rapid detection of these gases, thereby facilitating timely preventive measures. This study aims to investigate the adsorption capabilities of both pristine and decorated Be10O10 nanorings for the adsorbtion of toxic gases, specifcally HCN, ClCN, H2S and SO2, utilizing Density Functional Theory (DFT) calculations at the B3LYP/6–311+ +G(d,p) level of theory. The results obtained from the optimized structures reveal the interaction of pristine and decorated Be10O10 nanorings with gas molecules, resulting in four conformations labeled A to D. In conformations A and B, Be10O10 interact through two active sites, namely oxygen (O) and beryllium (Be). The adsorption process in these conformations is characterized as physisorption due to weak nature interaction. To enhance the adsorption capacity, we decorated an magnesium (Mg) atom was incorporated into the Be10O10 nanoring, leading to the formation of conformations C and D. In conformation C, the Mg atom is situated between two Be atoms as Be-Mg-Be. In contrast, in conformation D, the Mg atom is localized between two O atoms as O-Mg-O. The adoption energy results indicate that the decorated nanorings exhibit signifcantly improved adsorption of gas molecules compared to pristine Be10O10. Furthermore, both conformations C and D demonstrate a greater tendency to adsorb SO2 gas, whereas H2S gas shows a lower tendency in both conformations. Future studies will focus on the experimental validation of these fndings and the development of practical nanosensor devices for real-world applications.