Diatoms are one of the most abundant and diverse groups of phytoplankton and play a major role in marine ecosystems and the Earth's biogeochemical cycles. Here we combine DNA metabarcoding data from the Tara Oceans expedition with palaeoenvironmental data and phylogenetic models of diversification to analyse the diversity dynamics of marine diatoms. We reveal a primary effect of variation in carbon dioxide partial pressure (pCO2) on early diatom diversification, followed by a major burst of diversification in the late Eocene epoch, after which diversification is chiefly affected by sea level, an influx of silica availability and competition with other planktonic groups. Our results demonstrate a remarkable heterogeneity of diversification dynamics across diatoms and suggest that a changing climate will favour some clades at the expense of others.