This study proposes upcycling polymeric waste, i.e., waste floral foam, into high-performance nanoporous carbon that efficiently captures CO 2 . This paper presents strategies for improving the properties of nanoporous carbon, which aid in a superior CO 2 capture performance. Initially, pristine nanoporous carbon was produced from waste floral foam using various KOH impregnation ratios. The nanoporous carbon with a 1:2 (waste floral foam:KOH) ratio exhibiting optimal CO 2 capture capability was further advanced through single and dual atom doping. The doping of N and codoping of N,S atoms into the nanoporous carbon altered its textural and surface chemical properties, making them efficient for CO 2 capture. Comparative CO 2 capture studies of pristine nanoporous carbon (NC-x), N-doped nanoporous carbon (N-NC2), and N,S-codoped nanoporous carbon (N,S-NC2) demonstrate the superiority of N-doping. N-doped nanoporous carbon exhibited the largest ultramicroporosity (0.3100 cm3/g, 63.43%) and highest heteroatom content (34.94 atomic %), contributing to its enhanced CO 2 capture capability (4.54 mmol/g). Implementing the "waste-to-depollution" approach, this research lays the groundwork for producing low-cost, environmentally friendly nanoporous carbon with remarkable CO 2 capture attributes.