Urban parks, a core component of urban landscapes, play a crucial role in mitigating the negative effects of rapid urbanization and achieving sustainable urban development. In densely populated urban environments, providing urban parks fairly and efficiently, taking social preferences into account, is an important challenge. In this regard, we take Hangzhou, China, as an example and use a hedonic pricing model with a difference-in-differences estimator to test the effect of different types of urban parks on housing prices, quantify their respective economic values, and reflect homebuyers’ preferences. The findings indicate that the construction of new urban parks leads to an overall increase in the value of the surrounding real estate to some extent. Specifically, the construction of comprehensive parks and large parks significantly enhances the value of nearby housing, while proximity to new medium-sized parks also results in a housing price premium, albeit to a lesser extent. In contrast, community parks and specialized parks have a less significant impact on housing prices. These findings provide valuable insights for equitable urban development and planning, optimizing the allocation of urban parks and determining investment priorities for different types of parks to enhance the sustainability of the urban environment and human well-being.