A hammer-on is a playing technique performed on a stringed instrument (especially on a fretted string instrument, such as a guitar) by sharply bringing a fretting-hand finger down on the fingerboard behind a fret, causing a note to sound. This technique is the opposite of the pull-off.
Passages in which a large proportion of the notes are performed as hammer-ons and pull-offs instead of being plucked or picked in the usual fashion are known in classical guitar terminology as legato phrases. The sound is smoother and more connected than in a normally picked phrase, due to the absence of the necessity to synchronize the plucking of one hand with the fingering on the fingerboard with the other hand; however, the resulting sounds are not as brightly audible, precisely due to the absence of the plucking of the string, the vibration of the string from an earlier plucking dying off.
The technique also facilitates very fast playing because the picking hand does not have to move at such a high rate, and coordination between the hands only has to be achieved at certain points. Multiple hammer-ons and pull-offs together are sometimes also referred to colloquially as "rolls", a reference to the fluid sound of the technique.
A hammer-on is usually represented in guitar tablature (especially that created by computer) by a letter h.
A rapid series of alternating hammer-ons and pull-offs between a single pair of notes is called a trill.
In the Banjo tutor book "Ellis's Thorough Course For 5 String Banjo" published prior to 1900, the term 'Hammer on' is used to describe the action of performing an embellishment called 'the Shake'. The description is :- " The Shake, which is marked 'tr', is played in the following manner. Strike(pick) the first note only with the right hand & the remainder of the passage with the 2nd finger of the left hand, by 'hammering on' the string while it is vibrating". In the same tutor book, the action 'pull off' is termed the 'snap'. 
- Traum, Happy (1974). Bluegrass Guitar, p.25. ISBN 0-8256-0153-3.
- PBS Documentary Give Me the Banjo and the book Southern Mountain Banjo, p. 24: https://books.google.com/books?id=EDaj1IzYA74C&pg=PA24&lpg=PA24#v=onepage&q&f=false