Street trees are vital in mitigating urban heat islands, with their cooling effect significantly influenced by the urban layout. Past studies explored how urban canyon characteristics—aspect ratio, building coverage—affect tree cooling, yet seldom analyzed the impact of distance between trees and buildings. Addressing this, our study evaluates tree cooling effects concerning their proximity to shaded and sunlit walls. The findings highlight that cooling effectiveness varies with the ratio of distance from the shaded wall to building height (Dsha:H), peaking within a ratio range of 0.55 to 0.7. Below a ratio of 0.3, effectiveness decreases to 9–29 %, emphasizing the importance of strategic planting distances. The result shows that when planted at an optimal distance from buildings, small trees can produce similar radiation mitigation effects to those of larger trees. This discovery advocates for thoughtful tree placement in high-density areas, optimally leveraging their shade and evapotranspiration benefits. The study provides actionable insights for urban planners and landscape architects, suggesting that careful consideration of tree placement relative to building shadows can significantly improve urban climates, offering a strategic approach to deploying green infrastructure in high-rise complexes for enhanced climate resilience.