Water scarcity contributes to the poverty of around one-third of the world's people. Despite many benefits, tree planting in dry regions is often discouraged by concerns that trees reduce water availability. Yet relevant studies from the tropics are scarce, and the impacts of intermediate tree cover remain unexplored. We developed and tested an optimum tree cover theory in which groundwater recharge is maximized at an intermediate tree density. Below this optimal tree density the benefits from any additional trees on water percolation exceed their extra water use, leading to increased groundwater recharge, while above the optimum the opposite occurs. Our results, based on groundwater budgets calibrated with measurements of drainage and transpiration in a cultivated woodland in West Africa, demonstrate that groundwater recharge was maximised at intermediate tree densities. In contrast to the prevailing view, we therefore find that moderate tree cover can increase groundwater recharge, and that tree planting and various tree management options can improve groundwater resources. We evaluate the necessary conditions for these results to hold and suggest that they are likely to be common in the seasonally dry tropics, offering potential for widespread tree establishment and increased benefits for hundreds of millions of people.