Structure–reactivity relationships for nanoparticle-based catalysts have been greatly influenced by the study of catalytic materials with either supported isolated metal atoms or metal clusters comprising a few atoms. The stability of these metal species is a key challenge because they can sinter into large nanoparticles under harsh reaction conditions. However, stability can be achieved by confining the nanoparticles in crystalline porous materials (such as zeolites and metal–organic frameworks). More importantly, the interaction between the metal species and the porous framework may modulate the geometric and electronic structures of the subnanometric metal species, especially for metal clusters. This confinement effect can induce shape-selective catalysis or different chemoselectivity from that of metal atoms supported on open-structure solid carriers. In this Review, we discuss the structural features, synthesis methodologies, characterization techniques and catalytic applications of subnanometric species confined in zeolites and metal–organic frameworks. We make a critical comparison between confined and non-confined isolated atoms and metal clusters, and provide future perspectives for the field. Supported isolated metal atoms and subnanometric metal clusters are emerging catalytic materials. This Review discusses the influence of confining subnanometric metal species in zeolites and metal–organic frameworks on their geometric and electronic structures and catalytic performance.