mid-15c., apparently imitative of forcible exhaling. Extended sense of "to bluster with arrogance or indignation" is attested from 1590s. Related: Huffed; huffing. As a slang term for a type of narcotics abuse, by 1996. Huff cap was 17c. slang for "swaggerer, blusterer" (i.e., one with an inflated head), and was noted in 1577 among the popular terms for "strong beer or ale" (with mad dog and dragon's milk), probably because it goes to the head and huffs one's cap.
1590s, "a puff of wind," also "a swell of sudden anger or arrogance," from huff (v.). To leave in a huff is recorded from 1778.