This topical review focuses on recent advances in the understanding of the formation of surface nanostructures, an intriguing phenomenon in ion-surface interaction due to the impact of individual ions. In many solid targets, swift heavy ions produce narrow cylindrical tracks accompanied by the formation of a surface nanostructure. More recently, a similar nanometric surface effect has been revealed for the impact of individual, very slow but highly charged ions. While swift ions transfer their large kinetic energy to the target via ionization and electronic excitation processes (electronic stopping), slow highly charged ions produce surface structures due to potential energy deposited at the top surface layers. Despite the differences in primary excitation, the similarity between the nanostructures is striking and strongly points to a common mechanism related to the energy transfer from the electronic to the lattice system of the target. A comparison of surface structures induced by swift heavy ions and slow highly charged ions provides a valuable insight to better understand the formation mechanisms.