The quantum-mechanical nuclear-shell structure determines the stability and limits of the existence of the heaviest nuclides with large proton numbers Z ≳ 100 (refs. 1-3). Shell effects also affect the sizes and shapes of atomic nuclei, as shown by laser spectroscopy studies in lighter nuclides4. However, experimental information on the charge radii and the nuclear moments of the heavy actinide elements, which link the heaviest naturally abundant nuclides with artificially produced superheavy elements, is sparse5. Here we present laser spectroscopy measurements along the fermium (Z = 100) isotopic chain and an extension of data in the nobelium isotopic chain (Z = 102) across a key region. Multiple production schemes and different advanced techniques were applied to determine the isotope shifts in atomic transitions, from which changes in the nuclear mean-square charge radii were extracted. A range of nuclear models based on energy density functionals reproduce well the observed smooth evolution of the nuclear size. Both the remarkable consistency of model prediction and the similarity of predictions for different isotopes suggest a transition to a regime in which shell effects have a diminished effect on the size compared with lighter nuclei.