Pterosaurs were the first flying vertebrates and formed important components of terrestrial and marginal marine ecosystems during the Mesozoic. They became extinct during the latest Cretaceous (latest Maastrichtian), at, or near, the Cretaceous/Paleogene boundary, following an apparent decline in diversity in the Late Cretaceous. This reduction in species richness has been linked to the ecological radiation of birds in the Early Cretaceous and the proposal that birds competitively excluded pterosaurs from many key niches. However, although competition is often posited as a causal mechanism for many of the clade-clade replacements observed in the fossil record, these hypotheses are rarely tested. Here we present a detailed examination of pterosaur diversity through time, including both taxic and phylogenetically corrected diversity estimates and comparison of these estimates with a model describing temporal variation in the number of pterosaur-bearing formations (a proxy for rock availability). Both taxic and phylogenetic diversity curves are strongly correlated with numbers of pterosaur-bearing formations, suggesting that a significant part of the signal contained within pterosaur diversity patterns may be controlled by geological and taphonomic megabiases rather than macroevolutionary processes. There is no evidence for a long-term decline in pterosaur diversity through the Cretaceous, although a reduction in morphological, ecological, and phylogenetic diversity does appear to have occurred in the latest Cretaceous. Competitive replacement of pterosaurs by birds is difficult to support on the basis of diversity patterns.