Pyrenoids are subcompartments of algal chloroplasts that increase the efficiency of Rubisco-driven CO2 fixation. Diatoms fix up to 20% of global CO2, but their pyrenoids remain poorly characterized. Here, we used in vivo photo-crosslinking to identify pyrenoid shell (PyShell) proteins, which we localized to the pyrenoid periphery of model pennate and centric diatoms, Phaeodactylum tricornutum and Thalassiosira pseudonana. In situ cryo-electron tomography revealed that pyrenoids of both diatom species are encased in a lattice-like protein sheath. Single-particle cryo-EM yielded a 2.4-Å-resolution structure of an in vitro TpPyShell1 lattice, which showed how protein subunits interlock. T. pseudonana TpPyShell1/2 knockout mutants had no PyShell sheath, altered pyrenoid morphology, and a high-CO2 requiring phenotype, with reduced photosynthetic efficiency and impaired growth under standard atmospheric conditions. The structure and function of the diatom PyShell provide a molecular view of how CO2 is assimilated in the ocean, a critical ecosystem undergoing rapid change.