Metallic nanowires show unique physical properties owing to their one-dimensional nature. Many of these unique properties are intimately related to electron–electron interactions, which have a much more prominent role in one dimension than in two or three dimensions. Here we report the direct visualization of quantum size effects responsible for preferred lengths of self-assembled metallic iridium nanowires grown on a germanium (001) surface. The nanowire length distribution shows a strong preference for nanowire lengths that are an integer multiple of 4.8 nm. Spatially resolved scanning tunneling spectroscopic measurements reveal the presence of electron standing waves patterns in the nanowires. These standing waves are caused by conduction electrons, that is the electrons near the Fermi level, which are scattered at the ends of the nanowire.