Hashtag, a word or phrase preceded by a hash (#) for identifying social media posts about the same subject, entered tech vernacular in the early 2000s.
Tech product designer Chris Messina is credited with being the inventor of the “hashtag”, proposing on Twitter that a hash (#) or “pound sign” could be used for groups in August 2007:
how do you feel about using # (pound) for groups. As in #barcamp [msg]?— messina.eth (@chrismessina) August 23, 2007
Two days later Messina would write a blog post, referring to these proposed groups as “tag channels” or “channel tags”, while also noting “To join a channel, simply add a tag hash (#)”. The next day, information technologist Stowe Boyd, posted a follow-up blog post entitled “Hash tags = Twitter groupings”, writing:
”My sense is that tags in Twitter, as elsewhere, define shared experience of some kind, involving all those using the tag. And the use can be either actively putting a hash tag (like “#hashtag”) into a tweet, or more passively opting to follow a stream of tweets related to a tagged theme.”
The hash symbol would go on to become ubiquitous on Twitter and spread to other social media platforms such as Instagram, Facebook and Snapchat. Despite its emergence in modern communication, it has a much longer and more complicated history, which you can read in my post about the origin of the hash.
The origin of the “tag”, meaning “to furnish or mark with”, is slightly more obscure. The noun from of ‘tag’ meant "a hanging ragged or torn piece (of cloth)[...] hanging from a garment” from the early 1400s. It was synonymous with “dag” or “clag”, which referred to a matted lock or clump of wool hanging from the backside of a sheep! Tag may also have been influenced by the word “tack” meaning ‘that which fastens or attaches’.
Sources: Chris Messina’s tweet | Chris Messina’s blog | OED Online