Global extreme weather events such as rainstorms, floods and droughts have become increasingly frequent, posing significant threats to human beings worldwide. Green infrastructure has been implemented for decades to mitigate these issues. However, its widespread adoption in cities is still limited. A lack of sustainable funds was viewed as a great challenge for its widespread implementation. Many developed countries have practiced public participation and stormwater fee systems to mitigate these challenges. To assess the value that citizens place on the ecosystem benefits provided by urban green infrastructure is of great importance for increasing public participation and their willingness to pay. Thus, this paper aims to explore public preferences and their willingness to pay for the benefits of green infrastructure to support the construction and maintenance costs. A discrete choice experiment method was employed and five attributes were selected: reduction in run-off pollutant, degrees of ponding, plant type, planting aesthetics and the amount of payment. The Ngene1.2 software was used to generate a questionnaire, and data collected from the case cities, Xianyang and Xi’xian New Area, China, were analyzed using the mixed logit model. The results revealed that in Xianyang, the willingness to pay was not significantly associated with cognition, while in Xi’xian New Area, willingness to pay was positively related to cognition. Respondents exhibited a significant willingness to pay for green infrastructure to achieve reduced degrees of ponding in both cities, as well as improving planting aesthetics in Xi’xian New Area. Based on these findings, we conclude that government decision-makers should prioritize disseminating knowledge about green infrastructure to residents before implementing such projects in communities. The findings provide valuable insights into the potential economic value of urban green infrastructure and can guide policymakers and urban planners in making decisions regarding the design, implementation, and management of green infrastructure. This study contributes to the understanding of citizen perspectives and the economic evaluation of ecosystem services provided by urban green infrastructure.