High-entropy alloys are a class of materials that contain five or more elements in near-equiatomic proportions. Their unconventional compositions and chemical structures hold promise for achieving unprecedented combinations of mechanical properties. Rational design of such alloys hinges on an understanding of the composition–structure–property relationships in a near-infinite compositional space. Here we use atomic-resolution chemical mapping to reveal the element distribution of the widely studied face-centred cubic CrMnFeCoNi Cantor alloy and of a new face-centred cubic alloy, CrFeCoNiPd. In the Cantor alloy, the distribution of the five constituent elements is relatively random and uniform. By contrast, in the CrFeCoNiPd alloy, in which the palladium atoms have a markedly different atomic size and electronegativity from the other elements, the homogeneity decreases considerably; all five elements tend to show greater aggregation, with a wavelength of incipient concentration waves as small as 1 to 3 nanometres. The resulting nanoscale alternating tensile and compressive strain fields lead to considerable resistance to dislocation glide. In situ transmission electron microscopy during straining experiments reveals massive dislocation crossslip from the early stage of plastic deformation, resulting in strong dislocation interactions between multiple slip systems. These deformation mechanisms in the CrFeCoNiPd alloy, which differ markedly from those in the Cantor alloy and other face-centred cubic high-entropy alloys, are promoted by pronounced fluctuations in composition and an increase in stacking-fault energy, leading to higher yield strength without compromising strain hardening and tensile ductility. Mapping atomic-scale element distributions opens opportunities for understanding chemical structures and thus providing a basis for tuning composition and atomic configurations to obtain outstanding mechanical properties.