Traditional metallic alloys are mixtures of elements in which the atoms of minority species tend to be distributed randomly if they are below their solubility limit, or to form secondary phases if they are above it. The concept of multiple-principal-element alloys has recently expanded this view, as these materials are single-phase solid solutions of generally equiatomic mixtures of metallic elements. This group of materials has received much interest owing to their enhanced mechanical properties1-5. They are usually called medium-entropy alloys in ternary systems and high-entropy alloys in quaternary or quinary systems, alluding to their high degree of configurational entropy. However, the question has remained as to how random these solid solutions actually are, with the influence of short-range order being suggested in computational simulations but not seen experimentally6,7. Here we report the observation, using energy-filtered transmission electron microscopy, of structural features attributable to short-range order in the CrCoNi medium-entropy alloy. Increasing amounts of such order give rise to both higher stacking-fault energy and hardness. These findings suggest that the degree of local ordering at the nanometre scale can be tailored through thermomechanical processing, providing a new avenue for tuning the mechanical properties of medium- and high-entropy alloys.