Biodiversity is spatially organized by climatic gradients across elevation and latitude. But do other gradients exist that might drive biogeographic patterns? Here, we show that rainforest's vertical strata provide climatic gradients much steeper than those offered by elevation and latitude, and biodiversity of arboreal species is organized along this gradient. In Philippine and Singaporean rainforests, we demonstrate that rainforest frogs tend to shift up in the rainforest strata as altitude increases. Moreover, a Philippine-wide dataset of frog distributions shows that frog assemblages become increasingly arboreal at higher elevations. Thus, increased arboreality with elevation at broad biogeographic scales mirrors patterns we observed at local scales. Our proposed 'arboreality hypothesis' suggests that the ability to exploit arboreal habitats confers the potential for larger geographical distributions because species can shift their location in the rainforest strata to compensate for shifts in temperature associated with elevation and latitude. This novel finding may help explain patterns of species richness and abundance wherever vegetation produces a vertical microclimatic gradient. Our results further suggest that global warming will 'flatten' the biodiversity in rainforests by pushing arboreal species towards the cooler and wetter ground. This 'flattening' could potentially have serious impacts on forest functioning and species survival.